iPhone device and simulator do not share a common runtime

Originator:craig.hockenberry
Number:rdar://6940652 Date Originated:
Status:Open Resolved:
Product:iPhone SDK Product Version:2.0 and later
Classification:Serious Bug Reproducible:Always
 
The iPhone device uses the modern (Objective C 2.0) runtime. The iPhone simulator uses the legacy runtime.

This makes it difficult to take advantage of new runtime features. One example is leaving ivar declarations out of an @interface (and relying solely on @property declarations.) To use this feature, you'd have to litter your code with #if !TARGET_OS_IPHONE.

Of course, the hard part is making sure that the word size in the simulator is the same as the device. I'm not asking for 64-bit NSIntegers when I'm testing my iPhone code :-)

Comments

I would like to see this resolved. Instead of duping this bug I'm commenting here. I'm sure others feel the same.

Don’t use #if !TARGET_OS_IPHONE, use #if !OBJC2 (which refers to the modern runtime, not as the naïve programmer might expect to Objective-C 2).

Edit: that’s supposed to have double underlines around it. Stupid undocumented text mangler.

By jens.ayton at June 2, 2009, 5:24 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!