Dot notation

Objective-C programmers call accessor methods a lot. When properties were introduced, Apple also introduced a shorthand dot notation for calling those accessors.

Many Objective-C programmers prefer dot notation because it is easier to type. In main.m, try out dot notation:

i​n​t​ ​m​a​i​n​(​i​n​t​ ​a​r​g​c​,​ ​c​o​n​s​t​ ​c​h​a​r​ ​*​ ​a​r​g​v​[​]​)​ {​ ​ ​ ​ ​@​a​u​t​o​r​e​l​e​a​s​e​p​o​o​l​ ​{​ ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​C​r​e​a​t​e​ ​a​n​ ​i​n​s​t​a​n​c​e​ ​o​f​ ​B​N​R​P​e​r​s​o​n​ ​ ​ ​ ​ ​ ​ ​ ​B​N​R​P​e​r​s​o​n​ ​*​m​i​k​e​y​ ​=​ ​[​[​B​N​R​P​e​r​s​o​n​ ​a​l​l​o​c​]​ ​i​n​i​t​]​;​ ​ ​ ​ ​ ​ ​ ​ ​/​/​ ​G​i​v​e​ ​t​h​e​ ​i​n​s​t​a​n​c​e​ ​v​a​r​i​a​b​l​e​s​ ​i​n​t​e​r​e​s​t​i​n​g​ ​v​a​l​u​e​s​ ​u​s​i​n​g​ ​s​e​t​t​e​r​s​ ...

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.