I want to do a conditional statement in my prototype such as:
if (${EXECUTABLE_NAME} == "MyAppName")
as I am using multiple targets for the custom skins of the app.
Thanks
I want to do a conditional statement in my prototype such as:
if (${EXECUTABLE_NAME} == "MyAppName")
as I am using multiple targets for the custom skins of the app.
Thanks
You can set a preprocessor-macro for your target name. To do so, all you do is open your targets info panel, find the section for "pre-processor macro" and enter "MY_APP_NAME".
Then at compile time, all you have to do is check if this exists.
-(BOOL) isMyAppName {
#ifdef MY_APP_NAME
return YES;
#else
return NO;
#endif
}
And later in your code, you can call this function to determine if the target is the one you want.
You can get the app name like this:
NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
NSString *theAppName = [info objectForKey:@"CFBundleDisplayName"];
if([theAppName isEqualToString:@"MyAppName"]) {
//...
}