Re: Re: Memory management question (passing objects to method)
Re: Re: Memory management question (passing objects to method)
- Subject: Re: Re: Memory management question (passing objects to method)
- From: Justin Spahr-Summers <email@hidden>
- Date: Tue, 1 Mar 2005 20:36:43 -0600
Except make sure you don't set it to 'nil' after an autorelease call.
That will get the autorelease pool to try and release a nil object.
Rather, call release (instead of autorelease), then set it to nil.
On Wed, 02 Mar 2005 00:48:33 +0100, Conor Dearden <email@hidden> wrote:
> Also if you release something and not immediately assign it a value, make
> sure to assign it an intrim value of nil. This is so that other release
> messages that might be called, don't try to release a non exciting object.
> Clean programming, avoids hassles.
>
> -(void)doSomething:(NSString *)aVar;
> {
> [localInstanceOfVar autorelease];
> localInstanceOfVar = nil;
> }
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden