How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

后端 未结 8 1520
旧时难觅i
旧时难觅i 2020-11-28 04:30

Apple advises using the following code to detect whether running on an iPad or iPhone/iPod Touch:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {         


        
8条回答
  •  自闭症患者
    2020-11-28 05:20

    I believe the answer is simply do not attempt to run the code on iPhone simulator 3.1.3 or earlier. Always compile with a 3.2 SDK. The iPhone simulator 3.2 will get you the iPad simulator, or compile for iPhone Device 3.2 and put the app on a phone to test it.

    There is no way to compile against 3.2 SDK and use a 3.1.3 or earlier simulator.

提交回复
热议问题