I have two targets in my iPhone iOS project: Production
and Preview
.
I now want to execute a line of code, only if I am in the target Preview
.
I guess this would have to be some sort of #ifdef ...
. I found a solution which does almost the thing I want but it uses the configuration and not the target.
Example:
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#ifdef MY_PREVIEW_TARGET
[SomeLibraryWhichIsInPreviewTarget someMethod];
#endif
// Code that applies for both targets ...
}
Thanks for your help
Sams solution worked fine.
Preprocessor Macros
to MY_PREVIEW_TARGET=YES
and then I can use my code above to check for the target.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With