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"]
精彩评论