Am 09.10.2009 um 11:30 schrieb Graham Cox:
In init and dealloc, it is usual & recommended to access the ivar
directly - not because self isn't defined (it is), but because at
those times you are usually only concerned with setting the ivar's
initial value (possibly to an object), or releasing it, without side
effects.
Graham,
thanks a lot for clarifying and I stand corrected in concerns of the
"self" definition: Don't know what crossed my mind, how should "init"
return the "self"-pointer without it being defined. So I'll change my
code to use accessors, although
[self setIvar:[self ivar] + 1];
instead of
iVar++;
looks a bit confusing to me. I read that
self.iVar++;
is also supported, but I just don't like the dot-syntax. At least not
yet ...
Thanks again, Matthias
_______________________________________________
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]