On Aug 7, 2010, at 08:52, Stefan Nobis wrote:

> I'm a bit curious about the Objective-C 2.0 property/synthesize
> mechanism. In all examples I've seen, an instance variable is declared
> for each property. But if I leave out the instance variable like in
> the following example, everything works fine, too.
> [...]
> So my question: What are the (possible) problems/implications if I
> leave out the declarations of instance variable of properties? What
> are the recommendations? More specific: Does the above also work/run
> on iOS?

The ability to omit the instance variable (called the "non-fragile instance 
variable" mechanism) is a feature of the latest Objective-C compilers and 
runtime, and is available for 64-bit Mac OS x64 applications, and applications 
running on an iOS device.

It is not available for 32-bit or PPC applications, or applications running on 
the iOS simulator. If you need your application to run in either of those 
environments, you should stick with declaring instance variable explicitly for 
now.

My guess is that simulator support for non-fragile instance variables is coming 
Real Soon Now, but that 32-bit Mac applications will never support them, so you 
might want to factor that into you decision making process.


_______________________________________________

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 arch...@mail-archive.com

Reply via email to