There are two runtimes for Cocoa/Objective-C: the legacy runtime and the "modern" runtime (that's what Apple calls it).
According to Apple's documentation, "iPhone applications and 64-bit programs on Mac OS X v10.5 and later use the modern version of the runtime".
So far so good.
Now, the "modern" runtime supports a feature called "synthesized instance variables", which means that you don't have to define an instance variable for every declared property. The instance variable will be added automatically. Quote from the iPhone Reference Library: "For the modern runtimes, instance variables are synthesized as needed. If an instance variable of the same name already exists, it is used."
If you use this feature in your iPhone app, it builds and runs fine on the iPhone (physical) device, but when you change the target to "iPhone Simulator", you get build errors:
synthesized property 'x' must either be named the same as a compatible ivar or must explicitly name an ivar
What's going on here? Isn't the iPhone simulator a real iPhone simulator? Does this mean that the simulator uses a different runtime than the physical iPhone?
How can I use this feature on the iPhone simulator?
EDIT:
The code which doesn't compile when targeting the iPhone Simulator is:
@interface MyClass : NSObject {
}
@property NSString *prop1;
@end
According to the documentation, this should work fine on the "modern" runtime, and indeed it does on the iPhone device, but it doesn't compile when changing the target to iPhone Simulator.