• 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: is protected broken, or am I?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Re: is protected broken, or am I? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: is protected broken, or am I?
  • Next by Date: Re: Help - Newbie Drag And Drop Question (again)
  • Previous by thread: Re: is protected broken, or am I?
  • Next by thread: Re: is protected broken, or am I?
  • Index(es):
    • Date
    • Thread