How do you get an iPhone's device name

前端 未结 9 1591
我在风中等你
我在风中等你 2020-11-29 22:26

If you open Settings -> General -> About, it\'ll say Bob\'s iPhone at the top of the screen. How do you programmatically grab that name?

9条回答
  •  春和景丽
    2020-11-29 23:10

    Here is class structure of UIDevice

    + (UIDevice *)currentDevice;
    
    @property(nonatomic,readonly,strong) NSString    *name;              // e.g. "My iPhone"
    @property(nonatomic,readonly,strong) NSString    *model;             // e.g. @"iPhone", @"iPod touch"
    @property(nonatomic,readonly,strong) NSString    *localizedModel;    // localized version of model
    @property(nonatomic,readonly,strong) NSString    *systemName;        // e.g. @"iOS"
    @property(nonatomic,readonly,strong) NSString    *systemVersion;
    

提交回复
热议问题