What will [[UIDevice currentDevice] model] return for "iPad"?
views:
1606answers:
3
A:
Well trying on simulator:
NSLog(@"%@",[[UIDevice currentDevice] model]);
it gives iPad Simulator, will update the answer when I will get the device ;)
Madhup
2010-03-29 06:26:31
i know it too :D
g.revolution
2010-03-29 12:50:23
@g.revolution : then wait for somebody to get the device and post the answer ;)
Madhup
2010-03-29 13:59:40
A:
You can use UI_USER_INTERFACE_IDIOM()
, which will either return UIUserInterfaceIdiomPhone
or UIUserInterfaceIdiomPad
. Bear in mind that on any device < 3.2, this is unavailable, so first check to see whether the property can be retrieved - in this case, it is not an iPad.
Or, alternatively, to specifically work out whether the platform is an iPad or not, use
if ([[[UIDevice currentDevice] model] containsString:@"iPad"]) {
// Your code goes here
}
Hope this helps ;)
jrtc27
2010-04-12 16:34:23