Property Declaration and Automatic Backing Storage Allocation

On the modern Objective C runtime (nonfragile-abi) they are the same, the ivar backing will be created automatically by the @synthesize declaration. This is the runtime used by iPhone, and 64 bit Mac OS X apps. 32 bit Mac OS X use the legacy runtime, where it is not possible to synthesize the ivar, and the second bit of code you wrote would not compile properly.

The most recent versions of the iPhone simulator use the modern runtime, but older ones don't. So while both code examples will work on actually iPhones (synthesizing the necessary storage), the second example will fail to compile for the simulator unless you have an up to date Xcode.


With the modern runtime they are the same (as already mentioned) except for the fact that the ivars that are not explicitly defined like in MyObject1 will not show up in the debugger when you view variables or hover the mouse over variables, you have to print out the variable values or set the summary of the variable in the variables view to display the properties.

I started using the MyObject2 way of doing things because of typing less but it is more annoying having to type in the gdb command line to view the variable state in the debugger :(