Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does @protected work in obj-c?



Mark,

On Thu, 21 Oct 2004 23:01:12 +1000, Mark Patterson
<email@hidden> wrote:
> I tried to define a base class with a variable, and have 2 subclasses
> reference that variable. But I got errors against all the places I
> referenced the variable. According to that page
> http://www.otierney.net/objective-c.html @protected is the default
> visibility. I am used to protected in Delphi meaning visible to any
> subclass.

What errors do you get? How do you declare your protected variables?

According to Apple's Objective-C specification, @protected means that
"the instance variable is accessible within the class that declares it
and within classes that inherit it," so that's what you're expecting.

Andréas

--
http://andreassaudemont.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >How does @protected work in obj-c? (From: Mark Patterson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.