UI_USER_INTERFACE_IDIOM is a macro that expands to some expression that checks the type of equipment at runtime, and not at compile time. So you want to change your definition of ROWCOUNT as a variable, not a constant or a macro.
NSUInteger rowCount; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) rowCount = 12; else rowCount = 5;
or more briefly:
NSUInteger rowCount = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 12 : 5;
source share