iOS學習 獲取設備基本信息
作者:佚名
本文介紹的是iOS學習 獲取設備基本信息,詳細又簡單的介紹了如何獲取的,我們來看內容。
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學習 獲取設備基本信息的內容介紹完了,希望本文對你有所幫助!
責任編輯:zhaolei
來源:
互聯網