I have noticed that this works in dev mode (testing on the simulator, etc):
#ifdef DEBUG
//do stuff
#endif
But when I archive and distribute test builds, the app does not act in DEBUG mode even though I’m still building with the developer profile. I would like DEBUG mode to always be the case unless I build with the deployment profile and submit to Apple.
For example, when sending test builds out, I don’t want to make people buy an in-app purchase, so I do something like this:
- (BOOL)isUpgradePurchased
{
#ifdef DEBUG
return YES;
#endif
//do the real stuff to determine if purchased and return YES or NO
}
So do I also need to set a preprocessor macro DEBUG=1 for “Release”?
You can also “Edit Scheme” to build Debug Configuration when archiving. See screenshot of “Edit Scheme” dialog in XCode.