ios判断用户设备

 

ios判断用户设备:

   if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone) {

        NSLog(@"Your dervice is phone!!");

    }elseif (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)

    {

        NSLog(@"Your dervice is ipad!!");

    }else{  NSLog(@"未识别您的设备......");  }

 

设备类型 iphone 和 ipad --- 下边的枚举 

UIUserInterfaceIdiom

The type of interface that should be used on the current device

typedef enum {

   UIUserInterfaceIdiomPhone,

   UIUserInterfaceIdiomPad,

} UIUserInterfaceIdiom;

posted @ 2012-08-14 18:26  zander  阅读(382)  评论(0编辑  收藏  举报