iOS學(xué)習 獲取設(shè)備基本信息
作者:佚名
本文介紹的是iOS學(xué)習 獲取設(shè)備基本信息,詳細又簡單的介紹了如何獲取的,我們來看內(nèi)容。
iOS學(xué)習 獲取設(shè)備基本信息是本文要介紹的內(nèi)容,有時需要獲取的iOS設(shè)備的基本信息,比如:
系統(tǒng)唯一標識
是什么設(shè)備:iPad還是iPhone等
iOS版本號
系統(tǒng)名稱
這是在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;
小結(jié):iOS學(xué)習 獲取設(shè)備基本信息的內(nèi)容介紹完了,希望本文對你有所幫助!
責任編輯:zhaolei
來源:
互聯(lián)網(wǎng)