Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>From the docs: <a href="https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/DefiningClasses/DefiningClasses.html" rel="nofollow">Apple Objective-C Programming Language</a> <em>(doesn't mention this anymore, but you can find it in <a href="https://developer.apple.com/legacy/library/documentation/Cocoa/Conceptual/ObjectiveC/ObjC.pdf" rel="nofollow">this retired document</a>)</em>.</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 <code>@protected</code> 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><code>Worker *ceo = [[Worker alloc] init];</code></p> <p><code>ceo-&gt;boss = nil;</code></p> </blockquote> <p>I have the compilation error using <code>LLVM GCC 4.2</code> (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 <code>LLVM Compiler 2.0</code> whithout error.</p> <p>For compiling with <code>LLVM GCC 4.2</code> and <code>GCC 4.2</code> with the use of <code>self-&gt;</code>:</p> <blockquote> <p><code>[NSArray arrayWithObjects:self.barProperty, self-&gt;fooInstanceVar, nil];</code> in the <code>doSomethingWithProperty</code> method.</p> </blockquote>
 

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