I thought I understood @property and @synthesize, but I did some experimenting and I can\'t figure out why the below (what I thought was broken) code works.
As you c
You can omit instance variable declaration only for 64-bit architecture
I want to add that although the instance variable is automatically created, it's named the same as the property. By doing this, you may get bugs in your code later. So, besides preventing the case of not automatically generating on some architectures, you should always create the instance variable so that you don't get anything unexpected later on down the road.
The quick answer is: "yes". In Objective-C 2.0, synthesized properties will automatically create the corresponding ivars as required.
Apple's documentation has some more details.
Important: As pointed out by Tommy (note: this is from the legacy docs - please see the latest information):
In Objective-C 2.0 on either of the modern runtimes (ie, Intel 64bit and ARM) properties can be added to classes 'dynamically' (that is, at runtime but only before the creation of any instances — not particularly dynamic compared to the rest of the runtime). However, this can't be done on either of the two older runtimes (ie, Intel 32bit and PowerPC). It's therefore not really something you want to use on shipping software for the Mac or during development for iOS (since the simulator is a 32bit Intel application and can't create instance variables at runtime)