// *** before: ***
// reading and writing went through message sending only
Person *person = [[Person alloc] init];
[person setName:@"Ann"];
[person setAge:31];
NSString *text = [person name];
int years = [person age];
// nesting grew from the inside out and was hard to read
[[person address] setCity:@"Kazan"];
NSString *city = [[person address] city];
// *** in version 2.0: ***
// the dot is the same message send, written shorter
Person *person = [[Person alloc] init];
person.name = @"Ann"; // means [person setName:@"Ann"]
person.age = 31; // means [person setAge:31]
NSString *text = person.name;
int years = person.age;
person.address.city = @"Kazan";
NSString *city = person.address.city;
// the dot works with any pair of accessors, not with properties only
NSUInteger count = array.count; // means [array count]