• 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: Understanding property/synthesize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding property/synthesize


  • Subject: Re: Understanding property/synthesize
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 8 Aug 2010 22:07:10 -0700

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 (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: Understanding property/synthesize
      • From: Stefan Nobis <email@hidden>
    • Re: Understanding property/synthesize
      • From: Stefan Nobis <email@hidden>
    • Re: Understanding property/synthesize
      • From: David Duncan <email@hidden>
References: 
 >Understanding property/synthesize (From: Stefan Nobis <email@hidden>)

  • Prev by Date: help with linking combo boxes
  • Next by Date: Re: Problems with NSCell setObjectValue
  • Previous by thread: Understanding property/synthesize
  • Next by thread: Re: Understanding property/synthesize
  • Index(es):
    • Date
    • Thread