How can I get UI_USER_INTERFACE_IDIOM
How can I get UI_USER_INTERFACE_IDI开发者_如何学JAVAOM, I am not clear that how does it work, can anyone please guide me?
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
// iPad device
} else {
// iPhone / iPod touch device
}
From the Apple Header files:
/* The UI_USER_INTERFACE_IDIOM() macro is provided for use when deploying to a version of the iOS less than 3.2. If the earliest version of iPhone/iOS that you will be deploying for is 3.2 or greater, you may use -[UIDevice userInterfaceIdiom] directly. */
#define UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)
精彩评论