Re: Beginner memory management question
Re: Beginner memory management question
- Subject: Re: Beginner memory management question
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 3 Dec 2008 22:27:11 -0700
On Dec 3, 2008, at 3:13 AM, Jacob Rhoden wrote:
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?
Yes, but that's not your problem.
I tried reading the documentation on NSTextField but it didnt give
me a clue about if I needed to "retain".
That's because the documentation has assumed you've read the rules for
memory management. Read those rules ASAP, or turn on garbage
collection and let the collector manage memory.
(Infact stringValue is not even mentioned in the NSTextField
documentation).
That's because it's a method of NSControl, of which NSTextField is a
subclass. And it's mentioned in the NSControl documentation.
-(IBAction) addStockItem:(id)sender {
if(newName == nil) [newName release];
I think you meant to make that a !=, not a ==. Right now your code is
calling -release if it is nil, which makes no sense.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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