第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

如何以編程方式檢測設(shè)備運(yùn)行在哪個(gè)IOS版本上?

如何以編程方式檢測設(shè)備運(yùn)行在哪個(gè)IOS版本上?

撒科打諢 2019-07-11 13:20:10
如何以編程方式檢測設(shè)備運(yùn)行在哪個(gè)IOS版本上?我想檢查用戶是否在iOS上運(yùn)行的應(yīng)用程序少于5.0,并在應(yīng)用程序中顯示一個(gè)標(biāo)簽。如何以編程方式檢測用戶設(shè)備上運(yùn)行的IOS?謝謝!
查看完整描述

3 回答

?
一只萌萌小番薯

TA貢獻(xiàn)1795條經(jīng)驗(yàn) 獲得超7個(gè)贊

更新

在iOS 8中,我們可以使用新的isOperatingSystemAtLeastVersion方法上NSProcessInfo

   NSOperatingSystemVersion ios8_0_1 = (NSOperatingSystemVersion){8, 0, 1};
   if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:ios8_0_1]) {
      // iOS 8.0.1 and above logic
   } else {
      // iOS 8.0.0 and below logic
   }

請注意,這將在IOS 7上崩潰,因?yàn)锳PI在IOS 8之前并不存在。

if ([NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]) {
  // conditionally check for any version >= iOS 8 using 'isOperatingSystemAtLeastVersion'} else {
  // we're on iOS 7 or below}

原文答案IOS<8

為了完整起見,以下是蘋果自己在iOS 7 UI過渡指南,這涉及到檢查“基礎(chǔ)框架”版本。

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
   // Load resources for iOS 6.1 or earlier} else {
   // Load resources for iOS 7 or later}


查看完整回答
反對 回復(fù) 2019-07-11
?
尚方寶劍之說

TA貢獻(xiàn)1788條經(jīng)驗(yàn) 獲得超4個(gè)贊

我知道我回答這個(gè)問題太遲了。我不確定我的方法是否仍然適用于低iOS版本(<5.0):


NSString *platform = [UIDevice currentDevice].model;


NSLog(@"[UIDevice currentDevice].model: %@",platform);

NSLog(@"[UIDevice currentDevice].description: %@",[UIDevice currentDevice].description);

NSLog(@"[UIDevice currentDevice].localizedModel: %@",[UIDevice currentDevice].localizedModel);

NSLog(@"[UIDevice currentDevice].name: %@",[UIDevice currentDevice].name);

NSLog(@"[UIDevice currentDevice].systemVersion: %@",[UIDevice currentDevice].systemVersion);

NSLog(@"[UIDevice currentDevice].systemName: %@",[UIDevice currentDevice].systemName);

您可以得到以下結(jié)果:


[UIDevice currentDevice].model: iPhone

[UIDevice currentDevice].description: <UIDevice: 0x1cd75c70>

[UIDevice currentDevice].localizedModel: iPhone

[UIDevice currentDevice].name: Someones-iPhone002

[UIDevice currentDevice].systemVersion: 6.1.3

[UIDevice currentDevice].systemName: iPhone OS


查看完整回答
反對 回復(fù) 2019-07-11
  • 3 回答
  • 0 關(guān)注
  • 696 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號