iOS学习 获取设备基本信息是本文要介绍的内容,有时需要获取的iOS设备的基本信息,比如:
系统唯一标识
是什么设备:iPad还是iPhone等
iOS版本号
系统名称
这是在iPad模拟器上显示的信息,如图所示:
在iPad真机上显示,如图所示:
代码:
- - (void)viewDidLoad {
- NSString *content=[[NSString alloc]
- initWithFormat:
- @"unique id: %@ \nlocalized model: %@ \nsystem version: %@ \nsystem name: %@ \nmodel: %@",
- [[UIDevice currentDevice] uniqueIdentifier],
- [[UIDevice currentDevice] localizedModel],
- [[UIDevice currentDevice] systemVersion],
- [[UIDevice currentDevice] systemName],
- [[UIDevice currentDevice] model]];
- label.text=content;
小结:iOS学习 获取设备基本信息的内容介绍完了,希望本文对你有所帮助!