判断设备是不是iPad
将模拟器改为Ipad时,调用
[[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad
判断设备是否为Ipad,但程序并未做出正确的判断,后来做出如下设置:
PROJECT->Build Settings->Deployment->Targeted Device Family->iPhone/iPad
再次调试程序,成功识别出设备
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { }