Iphone 如何获得用户界面习惯用法

Iphone 如何获得用户界面习惯用法,iphone,ios,ios4,Iphone,Ios,Ios4,我怎样才能获得用户界面习惯用法,我不清楚它是如何工作的,有人能给我指点一下吗 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // iPad device } else { // iPhone / iPod touch device } 从Apple头文件: /* The UI_USER_INTERFACE_IDIOM() macro is provided for use when deploying t

我怎样才能获得用户界面习惯用法,我不清楚它是如何工作的,有人能给我指点一下吗

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    // iPad device
} else {
    // iPhone / iPod touch device
}
从Apple头文件:

/* 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)

你是说密码吗?还是想了解这个概念