objective-c memory management question
I've people who use [variable release] and some other times variable = nil to clean up memory? When do you use each one? and what are the differences? ...
I've people who use [variable release] and some other times variable = nil to clean up memory? When do you use each one? and what are the differences? ...
i am creating a music application and i want to integrate facebook into my application.when the user logs in for the first time in facebook the log in page of facebook should be displayed and after when he clicks on the login button my custom dialog page should be displayed containing buttons of publish feed, retrieving friends and logou...
I have this very simple program where I just create an object and look at the retain count. #import <Foundation/Foundation.h> #import "GeometryCalculator.h" int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; GeometryCalculator *calculator = [[GeometryCalculator alloc] init...
Okay so I know I asked a similar question a while ago, but this is different. I now have two timers that go off on the TouchDown event of their respective buttons. On the TouchUpInside event I have respective code that tells each timer to [pressTimer invalidate] and pressTimer = nil. The problem that happens now since I added the second ...
is it possible to create a custom dialog login button for facebook ...
I have a very simple graph that I want to enable touch on, I have the first part working: plotSpace.delegate = self; and the method: -(BOOL)plotSpace:(CPPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point { NSLog(@"touched at: x: %f y: %f", point.x, point.y); } How do I convert the point "point...
Is there a way to update the 'listened to' status of an MPMediaItem from the iPod library? I've tried using MPMusicPlayerController in iPodMusicPlayer mode and it does not mark the podcast as listened to once it finishes playing. ...
So I have made a custom UIButton and added it to the code and made the connections in interfacebuiler. I want the button to work as a on and off switch, how do I do this correctly? I'm a beginner at iphone development and this is for a school project for this class I'm taking during the summer to get a head start for next semester. So ...
Hi :) I want to develop an application for iPhone that plays mp3 files. Which framework and functions should I work with? Thanks in advance, Sagifw ...
Hi everyone I have a configuration class in my objective-c app which reads a PLIST file with configuration data. I would then like to be able to read the value for any key with a single function, something like this: - () getValueforKey:(NSString *)key { some magic here.... return value; } The issue: Some of the values in t...
Hello, I'm new to objective c. My code has a scrolling back ground and in the fore ground is a spinning wheel. I can scroll the back ground and rotate the wheel UIImage view just fine. I'm having an issue with making the wheel rotate in the opposite direction when my background begins to scroll in the opposite direction. Here's my ...
Hi. With these variables: NSInteger dataStart; uint64_t dataSize[1]; const unsigned char *beginning; NSInteger bytesEnd; ...at these values: dataStart = 499 dataSize[0] = 427 beginning = 9060864 bytesEnd = 9061793 ...the following code: NSLog(@"dataStart = %d, dataSize[0] = %d, beginning = %d, bytesEnd = %d", dataStart, da...
Hello, I just spent a whole week tracking down and whacking memory leaks over the head, and I arrived on the other end of that week a little dazed. There has to be a better way to do this, is all I can think, and so I figured it was time to ask about this rather heavy subject. This post turned out to be rather huge. Apologies for that,...
I'm converting a Java library to Objective-C. The Java code uses exceptions flagrantly (to my Objective-C accustomed mind). When converting, should I be throwing Objective-C exceptions (only within the library; I'll catch them before they leave) or should I use NSError constructs. I'm familiar with the use-case for exceptions in regular...
Hey there, Just have a quick question, event.header is type String , I need to set the object but I'm unsure what I have to set it to? it's set to String ? I'm getting this error "object can not be set" event.header = [values objectAtIndex:0]; event.longitude = [[values objectAtIndex:2] floatValue]; Thanks ...
This is from a category that I'm using to modify UIView. The code works, but in the first method (setFrameHeight) I'm using a block and in the second method (setFrameWidth) I'm not. Is there any way to use blocks more efficiently in this example? typedef CGRect (^modifyFrameBlock)(CGRect); - (void) modifyFrame:(modifyFrameBlock) block ...
Hello, I'm trying to detect when a verification code is entered into a text field, so like if I wanted someone to type in "this is a test.", it would then run the following code: system("say this is a test"); But I keep getting the error "void value not ignored as it ought to be". I have no idea what this means. This is what I have so...
So I'm beginning to learn how to use Cocoa. I think I've pretty much got it but I'm hung up on creating and switching views. I'm rewriting a game I made a little bit ago for practice. All I want is one window (preferably not resizable) and I want to be able to switch out views for different screens in the game. First, I have the main me...
Hi, I want to create an application for the iPhone that plays a custom memory buffer. I am currently using AVAudioPlayer class and I am pretty sure that the function I should use is "initWithData:error:". The problem is that I don't know which kind of data I have to pass as an argument, and reading the poor API doesn't help me much. C...
This is actually a two part question, hope my explanation is clear: I have an NSViewController which can be configured to show a different custom view on part of its view. For example, its view can show either CustomViewA or a CustomViewB. I was able to make this work by creating an NSViewController for each of the custom views and ini...