• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: Memory management question (passing objects to method)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Memory management question (passing objects to method)
      • From: mmalcolm crawford <email@hidden>
References: 
 >Re: Re: Memory management question (passing objects to method) (From: Conor Dearden <email@hidden>)

  • Prev by Date: Re: Load images?
  • Next by Date: Re: Help: How to show an application again after 5 days?
  • Previous by thread: Re: Re: Memory management question (passing objects to method)
  • Next by thread: Re: Memory management question (passing objects to method)
  • Index(es):
    • Date
    • Thread