I have a project with several goals for several clients, but most applications are very the same, and so far I have been able to control different program flows with lists of properties that are read at runtime.
One client has a certain idea that I need to show in front of everyone else.
My problem is that I get a build error (actually a link error), because since the controller class is not included in other target clients, and I also don't want to include it. So I was looking for some compile time control.
I'm looking for something like
#ifdef client1target
... do something
#else
... do something else
#endif
In the part of the program that I encountered, it looks like this:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString *client = [myEnvVariables getShortName];
if ([client isEqualToString:@"CLIENT1"]) {
Client1SpecificController *mm = [[Client1SpecificController alloc] initWithNibName:@"Client1SpecificView" bundle:nil];
mm.view.frame = CGRectMake(0,20,320,460);
[window addSubview:mm.view];
[window makeKeyAndVisible];
} else {
[window addSubview:navigationController.view];
[window makeKeyAndVisible];
}
return YES;
}
The error looks like this:
undefined symbols:
"_OBJC_CLASS_$_Client1SpecificController", referenced from:
objc-class-ref-to-Client1SpecificController in myAppDelegate.o