调用[[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad判断设备

拓拔弘亮
2023-12-01

将模拟器改为Ipad时,调用[[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad判断设备是否为Ipad,但程序并未做出正确的判断,后来做出如下设置:

PROJECT->Build Settings->Deployment->Targeted Device Family->iPhone/iPad

再次调试程序,成功识别出设备

 类似资料: