• 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: Releasing ivars in -didTurnIntoFault. Should set to nil?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing ivars in -didTurnIntoFault. Should set to nil?


  • Subject: Re: Releasing ivars in -didTurnIntoFault. Should set to nil?
  • From: Dave Keck <email@hidden>
  • Date: Wed, 12 Aug 2009 10:59:31 -1000

>
> >Now I understand that if nilling an instance variable after releasing
> >it is done in -dealloc, it is papering over other memory management
> >problems and is therefore bad programming practice.  But I believe
> >that this practice is OK in -didTurnIntoFault because, particularly
> >when Undo is involved, -didTurnIntoFault may be invoked more than once
> >on an object.  Therefore nilling after releasing in -didTurnIntoFault
> >is recommended.
>

I've found that there's never any reason not to reset a variable after
releasing it. IMO it's just good practice.
_______________________________________________

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

  • Follow-Ups:
    • Re: Releasing ivars in -didTurnIntoFault. Should set to nil?
      • From: "Georg C. Brückmann" <email@hidden>
References: 
 >Releasing ivars in -didTurnIntoFault. Should set to nil? (From: Jerry Krinock <email@hidden>)
 >Re: Releasing ivars in -didTurnIntoFault. Should set to nil? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Cocoaheads Lake Forest (92630) meeting 8/12/2009 at 7 pm on Distilled NSCoder Night Experiences creating an iPhone app
  • Next by Date: Changing font color
  • Previous by thread: Re: Releasing ivars in -didTurnIntoFault. Should set to nil?
  • Next by thread: Re: Releasing ivars in -didTurnIntoFault. Should set to nil?
  • Index(es):
    • Date
    • Thread