我有以下预处理器代码来检测设备是iPhone还是iPad,我想要添加iPhone5:
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define POS_UI_CHEST ( (IS_IPAD) ? (ccp(72.0,831.0)) : (ccp(33.0,396.0)) )
#define POS_UI_ROUTE ( (IS_IPAD) ? (ccp(74.0,521.0)) : (ccp(36.0,240.0)) )
#define POS_UI_GUAGE ( (IS_IPAD) ? (ccp(384.0,70.0)) : (ccp(160.0,20.0)) )
#define POS_UI_BALL ( (IS_IPAD) ? (ccp(384.0,70.0)) : (ccp(160.0,20.0)) )
为每个条件添加第三个ccp的最简单方法是什么?
谢谢!
答案 0 :(得分:1)
#define POS_UI_CHEST ( IS_IPAD ? ccp(72.0,831.0) : (IS_IPHONE5 ? ccp(xxx.0,yyy.0) : ccp(33.0,396.0)) )
(我删除了(不必要的(括号(for))((清晰度)))