i have a source file to put all my constants ( constant.h) like this :
#define MY_URL @"url"
#define SECOND_URL @"url2"
...
my problèm is to déclare a constant with a condition like this :
if (ipad)
#define MY_CONSTANT @"ipad"
else
#define MY_CONSTANT @"iphone"
How i can do this please and put it in the constant.h ?
if you support both ipad and iphone, you won’t know the device until runtime.
if you use a constants header, then you might approach the device specific definitions as follows:
constants.h
constants.m
Notes:
#definefor your constants, use theextern NSString* constapproach instead.