Perhaps the new @property() syntax makes it easy to forget about object lifetimes because it does the set/get/change automagically. These days when I add any property I go right to the dealloc method (and init if I have one) and ensure I've managed that property before I forget.

Yes, but this is exactly the point. If I have no property for an Outlet it's still retained.

Hey Brian -

Outlets for iPhone OS are established by calling setValue:forKeyPath:. The behavior of setValue:forKeyPath: is that if a setter exists, it is called. If a setter does not exist, the instance variable is looked up and set directly, and if it is an object, it is retained. This means that for IBOutlets, with no setters, they're retained in iPhone OS. This is different from Mac OS X. If you're writing code on both platforms, or are planning to, you should always use properties on both platforms since it makes the decision to retain outlets explicit and obvious.

Jon Hess
_______________________________________________

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