Speed is generally not something to be concerned about WRT property accessors. 
If you want to bypass the property accessor behavior when accessing an ivar, 
then access it directly.

Somewhere in Apple's docs I read a suggestion that IBOutlets be released in 
-dealloc by direct access, and released (in iOS only) in -viewDidUnload by 
setting the property to nil.

If you provide your own property accessor implementations, you will want to 
access the ivars directly to avoid recursion.

-- 
Rick

On Apr 26, 2011, at 20:28 , Guy Steven wrote:

> I am currently learning objective c and cocoa
> 
> I believe I understand the difference between properties and instance
> variables, and the effect of using properties as opposed to instance
> variables viz a viz KVO and memory management.
> 
> What I can't understand is why you would access instance variables directly
> within a class. My quess is speed. Is there any other reason?
> 
> And related to this, why give instance variables a name different to the
> name of the property.
> 
> Again, I suspect it may be a matter of style, but would like to know if
> there are cases where it is a necessity.
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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/rmann%40latencyzero.com
> 
> This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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