I'm searching for a way to dynamically detect the version of the objectivec runtime. It's different from iPhone Simulator (old) to iOS Devices (new) runtime.
And some fancy stuff actually depends on the differences. For now I hacked around that issue with a preprocessor define:
// simulator is a 32-bit mac app with old runtime, iOS devices have new runtime
// new runtime aligns stack variables differently
#if TARGET_IPHONE_SIMULATOR
stack += sizeof(__self) + sizeof(__cmd);
#endif
But that's kinda ugly and doesn't work with mac apps; is there a better way?