I think you MUST read the App doc about Encapsulating Data.
In particular, with the first code snippet you are saying to wrap an instance variable called _list
through accessor methods.
In general in OOP they are also called setters and getters. A good discussion of pros of them can be found in Why use getters and setters?.
So, comments of other people are right. Where does the list
variable come from?
An important thing you need to understand is that the dot syntax is a a concise way to access method calls. So, for example:
NSString *nickname = person.nickname;
person.nickname = @"This is my nickname";
is equal to
NSString *nickname = [person nickname];
[person setNickname:@"This is my nickname"];
A note. Starting form XCode 4.4, the new Apple LLVM compiler 4.0 allows you to skip the @synthesize
directive. Under the hood the compiler generates an instance variable with a _
suffix. Further references at Automatic Property Synthesis With Xcode 4.4.