4 iOS獲取裝置名稱

2021-07-07 10:04:32 字數 2216 閱讀 6556

適配一直是移動開發人員的痛苦之處。那麼今天在這裡把關於適配中獲取裝置名稱的方法匯合一下。

這是乙個類方法,需要匯入系統的標頭檔案

#import

//裝置名稱

+ (nsstring *)getddevicename

else

if ([strmodel isequaltostring:@"ipad2,1"] ||

[strmodel isequaltostring:@"ipad2,2"] ||

[strmodel isequaltostring:@"ipad2,3"] ||

[strmodel isequaltostring:@"ipad2,4"])

else

if ([strmodel isequaltostring:@"ipad3,1"] ||

[strmodel isequaltostring:@"ipad3,2"] ||

[strmodel isequaltostring:@"ipad3,3"])

else

if ([strmodel isequaltostring:@"ipad3,4"] ||

[strmodel isequaltostring:@"ipad3,5"] ||

[strmodel isequaltostring:@"ipad3,6"])

else

if ([strmodel isequaltostring:@"ipad4,1"] ||

[strmodel isequaltostring:@"ipad4,2"])

else

if ([strmodel isequaltostring:@"ipad2,5"] ||

[strmodel isequaltostring:@"ipad2,6"] ||

[strmodel isequaltostring:@"ipad2,7"])

else

if ([strmodel isequaltostring:@"ipad4,4"] ||

[strmodel isequaltostring:@"ipad4,5"])

else

if ([strmodel isequaltostring:@"iphone1,1"])

else

if ([strmodel isequaltostring:@"iphone1,2"])

else

if ([strmodel isequaltostring:@"iphone2,1"])

else

if ([strmodel isequaltostring:@"iphone3,1"] ||

[strmodel isequaltostring:@"iphone3,2"] ||

[strmodel isequaltostring:@"iphone3,3"])

else

if ([strmodel isequaltostring:@"iphone4,1"])

else

if ([strmodel isequaltostring:@"iphone5,1"] ||

[strmodel isequaltostring:@"iphone5,2"])

else

if ([strmodel isequaltostring:@"iphone5,3"] ||

[strmodel isequaltostring:@"iphone5,4"])

else

if ([strmodel isequaltostring:@"iphone6,1"] ||

[strmodel isequaltostring:@"iphone6,2"])

else

if ([strmodel isequaltostring:@"ipod1,1"])

else

if ([strmodel isequaltostring:@"ipod2,1"])

else

if ([strmodel isequaltostring:@"ipod3,1"])

else

if ([strmodel isequaltostring:@"ipod4,1"])

else

if ([strmodel isequaltostring:@"ipod5,1"])

else

return

[nsstringstringwithformat:

@"ios_%@"

, identifier]; }

iOS 獲取wifi ssid 名稱

ssid全稱service set identifier,即wifi網路的公開名稱.在ios 4.1以上版本提供了公開的方法來獲取該資訊.html view plain copy import systemconfiguration captivenetwork.h html view plain ...

ios 裝置獲取idfa iOS獲取裝置ID總結

ios獲取裝置id總結 udid 獲取 uidevice currentdevice uniqueidentifier 廢棄 ios6 idfv 獲取 uidevice currentdevice identifierforvendor uuidstring 適用 ios6.0 例子 95955f3...

獲取iOS裝置資訊

鑌哥就直接寫 了 獲取手機資訊 應用程式的名稱和版本號等資訊都儲存在mainbundle的乙個字典中,用下面 可以取出來 nsdictionary infodict nsbundle mainbundle infodictionary nsstring versionnum infodict obj...