I have a framework code that does this:
#ifdef USE_DOUBLE typedef double real; #else typedef float real; #endif
But when I try to use this type when USE_DOUBLE defined (like real == double) like this:
- (id) initSomeObject:(real)arg andSomeOtherStuff:(id)thing { self = [super init]; if (self) { field = arg; } } [someObject initSomeObject:2.0 andSomeOtherStuff:nil];
The arg value is completely destroyed, appearing as 5.3 ... e-315. However , if I turn off USE_DOUBLE off, a value of 2.0 works fine. This is the latest version of iOS 5+ using Xcode 4.3.3 and LLVM 3.1 on iPhone 4. Can't iOS handle duplication? Should my USE_DOUBLE flag be undef'd?
source share