Re: is protected broken, or am I?
Re: is protected broken, or am I?
- Subject: Re: is protected broken, or am I?
- From: Ondra Cada <email@hidden>
- Date: Mon, 14 Oct 2002 01:25:14 +0200
On Monday, October 14, 2002, at 01:06 , Matt Neuburg wrote:
"The instance variable is
accessible within the class that declares it and within classes that
inherit it."
On Fri, 11 Oct 2002 11:39:16 -0400, Brent Gulanowski <email@hidden>
said:
The central idea of objects is that they cannot get into each others'
ivars, even if they are of the exact same class.
If that's true,
It's exactly true (unless those ivars are @public).
then the above-quoted code from the docs is wrong.
Nope, as I believe a few people have written already, it's you who is
wrong.
@protected just protects the ivar from an external access: it is available
internally only, and that given, indeed "within the class that declares it
and within classes that inherit it".
@private limits the access even more: not only in self, but also only in
implementation of the class which declared the ivar.
This is exactly how the thing is documented, and also it is exactly how it
works. Needless to say, also the only reasonable way.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.