Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As replied in this question : <a href="https://stackoverflow.com/questions/6394989/objective-c-xcode-4-0-2-subclass-cant-access-superclass-variables-was-not-decl/6958905#6958905">objective c xcode 4.0.2: subclass can&#39;t access superclass variables &quot;was not declared in this scope&quot;</a></p> <p>From the doc : Apple Objective-C Programming Langage : <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocDefiningClasses.html#//apple_ref/doc/uid/TP30001163-CH12-TPXREF125" rel="nofollow noreferrer">http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocDefiningClasses.html#//apple_ref/doc/uid/TP30001163-CH12-TPXREF125</a></p> <blockquote> <p>The instance variable is accessible within the class that declares it and within classes that inherit it. All instance variables without an explicit scope directive have @protected scope.</p> <p>However, a public instance variable can be accessed anywhere as if it were a field in a C structure. For example:</p> <p>Worker *ceo = [[Worker alloc] init];</p> <p>ceo->boss = nil;</p> </blockquote> <p>I have the compilation error using LLVM GCC 4.2 (for an iOS project, on device) : </p> <blockquote> <p>error: 'fooInstanceVar' undeclared (first use in this function) and the same one using GCC 4.2 : error: 'fooInstanceVar' undeclared (first use in this function)</p> </blockquote> <p>I can compile using LLVM Compiler 2.0 whithout error.</p> <p>For compiling with LLVM GCC 4.2 and GCC 4.2 with the use of self-> :</p> <blockquote> <p>[NSArray arrayWithObjects:self.barProperty, self->fooInstanceVar, nil]; in the doSomethingWithProperty method.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload