Is it possible to use #define
in an "if" statement? The following code works, but I get a warning that the macro is being redefined.
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
#define TableViewHeight 916
#define DisplayHeight 1024
#define DisplayWidth 768
}
else {
#define TableViewHeight 374
#define DisplayHeight 480
#define DisplayWidth 320
}
I also tried this, but it didn't work:
#ifdef UIUserInterfaceIdiomPad
#define TableViewHeight 916
#define DisplayHeight 1024
#define DisplayWidth 768
#else
#define TableViewHeight 374
#define DisplayHeight 480
#define DisplayWidth 320
#endif
Any ideas?