• 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: Synthesized instance variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synthesized instance variables


  • Subject: Re: Synthesized instance variables
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Thu, 12 Mar 2009 18:42:50 +0100


Le 12 mars 09 à 17:54, Frank Illenberger a écrit :

And what prevent you to simply declare the ivar in the interface
instead of letting the compiler generating it ?

I second Andreas. For most cases, the correct place to declare instance variables should be the .m file as they are an implementation detail and not part of the contract with the outside world using the class.

As long as the ivar is declared @private, it is not part of any contract.


The symbol visibility on 64bits runtime will be set to hidden, and so the ivar cannot be referenced from an external binary (even if someone rewrite the .h file using @public instead of @private).



_______________________________________________

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


References: 
 >Re: Synthesized instance variables (From: Frank Illenberger <email@hidden>)

  • Prev by Date: Re: Performance problem with GC enabled
  • Next by Date: Re: Synthesized instance variables
  • Previous by thread: Re: Synthesized instance variables
  • Next by thread: Re: Synthesized instance variables
  • Index(es):
    • Date
    • Thread