Question: I want to have a constant in my project to change between Lite and Pro version. I don't think it is the best way to do it, but I am trying to:

1. add a constant in my app delegate

```
#define BUILD_PRO 1 //0 => LITE, 1 => PRO

```
2. when I need it I import the appDelegate and test it:

```
#import "myAppDelegate.h"

```

then later

```
#if (BUILD_PRO==1)
NSLog(@"this is pro version");
#endif

```

The problem is that this code works in some files and don't works in others. I haven't found any explanation for this behaviour; does anyone have an explanation for it?

What is the right way to have two versions (pro and lite) from the same project?

Answer: 
One way of doing this is to have a target for the pro version and a target for the light version. Then you declare your constants in the build settings under Preprocessor Macros of the pro version.

Then in your code you can do:

```
#ifdef BUILD_PRO
   //super awesome pro code here.
#endif

```
I declare a variable in the header of AppDelegate.m:

```
int DEVICE_TYPE;

```

And then in applicationDidFinishLaunching in my AppDelegate, I call:

```
- (void) setDeviceType {

  NSString* machineType = [[UIDevice currentDevice] machine];
  if ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"]) {
    DEVICE_TYPE = IPOD_TOUCH;
  } else if ([machineType isEqualToString:@"iPhone1,2"] || 
             [machineType isEqualToString:@"iPhone1,1"]) {
    DEVICE_TYPE = IPHONE3G;
  } else {
    DEVICE_TYPE = IPHONE3GS;
  }
}

```