[UIDevice currentDevice].model

  見名知意:是蘋果設備類型的彙總。

1. iPhone Simulator

 2.iPad Simulator

3.iPod touch

4.iPad

5.iPhone

 前面的數字,代表在設備裏面的排行,可以通過排行值的比較[[UIDevice currentDevice].model substringToIndex:4],得知設備型號是iPad;

如果數字不好識記,可以通過字符串比較,[[UIDevice currentDevice]model]isEqualToString:@"iPad",得知設備類型。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章