Beginner memory management question
Beginner memory management question
- Subject: Beginner memory management question
- From: Jacob Rhoden <email@hidden>
- Date: Wed, 03 Dec 2008 21:13:26 +1100
I am not sure how one would go about working this, Im writing my first
"test" os/x applications and I am thinking this is probably not right.
Am I doing the retain in the correct place? I tried reading the
documentation on NSTextField but it didnt give me a clue about if I
needed to "retain". (Infact stringValue is not even mentioned in the
NSTextField documentation).
@interface StockListController : NSObject {
IBOutlet NSTextField* stockName;
NSString *newName;
}
-(IBAction) addStockItem:(id)sender;
@end
@implementation StockListController
-(IBAction) addStockItem:(id)sender {
if(newName == nil) [newName release];
newName = [stockName stringValue];
[newName retain];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden