On Nov 19, 2008, at 4:11 PM, j o a r wrote:


On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote:

My understanding (and I'm a noob in this) is that "best practices"
recommend that you shouldn't start sending additional messages to an
object from inside its dealloc.


That is indeed correct. The official guideline is, AFAIK, to not call through your properties in init / dealloc.


I guess I really missed that part of the docs.

In all my desktop code, I always call my setters (non prop based) in dealloc:

[self setTitle:nil];
[self setColor:nil];
etc.


Just seemed natural to do self.title = nil, etc as I viewed properties as just a 1 to 1 replacement of manually setting stuff up.

Now, when you say "call through your properties in init/dealloc", is that explicitly for things set up with @property? Or, has what I've been doing all these years with calls to accessors in init/dealloc really "bad"?


In my case, I do have a decent amount of code being shared between platforms. And, such code doesn't yet use properties. After reading this thread, it's very temping to just rid myself of the properties and go back to rolling my own accessors as needed (I do have Accessorizer, so that task is not hard at all).

___________________________________________________________
Ricky A. Sharp         mailto:[EMAIL PROTECTED]
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to