Hi,
Just need 2 really basic clarifications.
1.
Lets say I have a class A which has a member delcared like: @property (nonatomic,retain) NSString* stringInstanceVariable ;
In one of my methods, I want to initialize stringInstanceVariable to be some string. Do I need to retain it or not ?
should I call:
stringInstanceVariable = [[NSString stringWithCString:"Hello"] retain];
Or
stringInstanceVariable = [NSString stringWithCString:"Hello"];
Or maybe I should call :
self.stringInstanceVariable = [NSString stringWithCString:"Hello"];
2.
Using interface builder , when I right click a textfield control for example, I get a list of methods. what are those exactly ? Notification that I can register to observe ? And I know I can implement and then connect them using IB, I just want to know if and how for example I can do this without IB using just code. Maybe I can do it by using "addTarget:action:forControlEvent".
But if that's the case then what is the difference between events and notifications in Cocoa ? or comparing to delegation is more appropriate.
Thanks