Re: Synthesized instance variables
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