• 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
Avoiding KVO in dealloc?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoiding KVO in dealloc?


  • Subject: Avoiding KVO in dealloc?
  • From: Todd Heberlein <email@hidden>
  • Date: Mon, 03 Aug 2009 16:35:12 -0700

While working through "Beginning iPhone 3 Development" I've seen the following a lot, and it seems like a general Cocoa issue.

In -viewDidUnload methods the code has the form:
	self.foo = nil;

Whereas in -dealloc methods the code has the form:
	[foo release];

Both methods seem to me to do the same thing (releasing foo), but I presume the first one would trigger any KVO observers where as the second wouldn't. Is that why the simple "release" is used instead of a setter in the dealloc methods, to avoid KVO? Is this a general Cocoa pattern?

Thanks,

Todd

_______________________________________________

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: Avoiding KVO in dealloc?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Table view data source methods order?
  • Next by Date: Re: Avoiding KVO in dealloc?
  • Previous by thread: NSUndoManager vs @synthesize
  • Next by thread: Re: Avoiding KVO in dealloc?
  • Index(es):
    • Date
    • Thread