Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think you <strong>MUST</strong> read the App doc about <a href="https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/EncapsulatingData/EncapsulatingData.html" rel="nofollow noreferrer">Encapsulating Data</a>.</p> <p>In particular, with the first code snippet you are saying to wrap an instance variable called <code>_list</code> through accessor methods.</p> <p>In general in OOP they are also called setters and getters. A good discussion of pros of them can be found in <a href="https://stackoverflow.com/questions/1568091/why-use-getters-and-setters">Why use getters and setters?</a>.</p> <p>So, comments of other people are right. Where does the <code>list</code> variable come from?</p> <p>An important thing you need to understand is that the dot syntax is a a concise way to access method calls. So, for example:</p> <pre><code>NSString *nickname = person.nickname; person.nickname = @"This is my nickname"; </code></pre> <p>is equal to</p> <pre><code>NSString *nickname = [person nickname]; [person setNickname:@"This is my nickname"]; </code></pre> <p>A note. Starting form XCode 4.4, the new Apple LLVM compiler 4.0 allows you to skip the <code>@synthesize</code> directive. Under the hood the compiler generates an instance variable with a <code>_</code> suffix. Further references at <a href="http://useyourloaf.com/blog/2012/08/01/property-synthesis-with-xcode-4-dot-4.html" rel="nofollow noreferrer">Automatic Property Synthesis With Xcode 4.4</a>.</p>
 

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