private redeclaration of an instance variable
private redeclaration of an instance variable
- Subject: private redeclaration of an instance variable
- From: Matt Neuburg <email@hidden>
- Date: Sat, 29 Jun 2013 10:23:18 -0700
As you know, these days, we are allowed to declare an instance variable in curly braces in the @implementation section rather than the @interface section. Well, then:
* Suppose two classes, MyClass and its subclass MyClass2.
* Suppose MyClass publicly declares an instance variable "thing".
I observe that if I try to redeclare "thing" (say, as a different data type) in MyClass2's @interface section, the compiler stops me, but it seems to be perfectly happy if I redeclare "thing" in MyClass2's @implementation section.
Am I reading this right? It's permitted to override an inherited instance variable, but only if you do so privately? m.
--
matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden