I want to define some variables depend on whether it is run on Iphone or Ipad application. So I wrote this code
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
#define ABC @"122"
NSLog(@"Ipad");
} else {
#define ABC @"123"
NSLog(@"iphone ");
}
NSLog(@" %@", ABC);
But in both iphone and Ipad it show 123.
Try this out:
This should work fine for you.