开发者

iphone - Detecting what type of simulator

how can I detect whether I'm using iphone simulator or ipad simulator. I'm using some 3rd party library to which I've to pass a parameter whether i'm using ipad or iphone. in order to test the app, i want to programatically detect whether i'm using iphone simulator or ipad simulator. is there any way to ident开发者_JAVA百科ify it?


if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
  // iPad code
}
else {
  // iPhone code
}


did you tried [[[UIDevice currentDevice] model] hasPrefix: @"iPad"]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜