• 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
private redeclaration of an instance variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: private redeclaration of an instance variable
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Cocoa-dev Digest, Vol 10, Issue 398
  • Next by Date: Re: private redeclaration of an instance variable
  • Previous by thread: Re: Cocoa-dev Digest, Vol 10, Issue 398
  • Next by thread: Re: private redeclaration of an instance variable
  • Index(es):
    • Date
    • Thread