Re: resetting ivars safely
Re: resetting ivars safely
- Subject: Re: resetting ivars safely
- From: Charles Steinman <email@hidden>
- Date: Thu, 13 Sep 2007 09:41:45 -0700 (PDT)
--- Daniel Child <email@hidden> wrote:
> A. Use a convenience constructor....
> [NSMutableArray array] OR
> [NSMutableArray arrayWithCapacity:]
> But do I have to worry that it will get autoreleased
> prematurely?
>
> B. Use alloc init autorelease [[NSMutableArray
> alloc] init]
> autorelease].
> Same question: could it get released too soon?
You should read the Cocoa memory management
documentation.
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043-BEHDEDDB
Cheers,
Chuck
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
_______________________________________________
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