iOS10你掉坑了嗎?

來源:互聯網
上載者:User

標籤:

 坑1: 系統導覽列上按鍵消失問題  坑2: canOpenURL 調用返回NO問題  坑3: iOS10 許可權崩潰問題  坑4: xib不好用了?別怕看這裡!  坑5: command +/注釋失效  坑6: 列印了一大堆0 1 的東西
坑1: 系統導覽列上按鍵消失問題問題:升級iOS10,使用系統導覽列,發現導覽列上按鈕全部消失了,無法返回上一級菜單。原因:iOS10會重新調用原生的導航,覆蓋現有的。解決方案:在基類(BaseViewController)裡面添加如下代碼- (void)viewWillDisappear:(BOOL)animated {    if (IsDeviceVersionIOS10) {        //相當於重新整理NavigationBar        [self.navigationController setNavigationBarHidden:YES     animated:NO];        [self.navigationController setNavigationBarHidden:NO     animated:NO];    }}
坑2: canOpenURL 調用返回NO問題由於iOS加入對使用者隱私以及禁止掃描系統資訊的控制,目前通過canOpenURL的方法來判斷使用者是否安裝特定app,則會出現-canOpenURL: failed for URL: "ABC://app/*******/" - error: "This app is not allowed to query for scheme ABC"的錯誤,修改起來很簡單,只需要在plist中加入ABC的白名單即可,如:<key>LSApplicationQueriesSchemes</key><array><string>ABC</string></array>注意:1.這裡需要添加白名單的是APP B(檢測端),而不是被檢測的 APP A     2.最多添加50個
坑3: iOS10 許可權崩潰問題This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app‘s Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.意思是說:你需要在info.plist檔案 添加一個" NSContactsUsageDescription "的Key,Value添加一個描述。相機許可權描述:    <key>NSCameraUsageDescription</key>    <string>cameraDesciption</string>通訊錄:    <key>NSContactsUsageDescription</key>    <string>contactsDesciption</string>麥克風:    <key>NSMicrophoneUsageDescription</key>    <string>microphoneDesciption</string>相機:    <key>NSPhotoLibraryUsageDescription</key>    <string>photoLibraryDesciption</string>備忘:Key 一定不能錯,Value 貌似可以隨便填寫

20160614172110952.jpg
坑4: xib不好用了?別怕看這裡!升級到Xcode7之後,發現Xib點擊會彈出一個提示,不然無法修改裡面內容,那麼就選擇Choose Device。重新update frame,就可以修改了,修改之後記得選擇回去,不然打包會報錯,如

圖1 點擊xib出現


螢幕快照 2016-09-20 上午11.56.23.png

圖2 修改後打包報錯


螢幕快照 2016-09-20 上午11.57.10.png

圖3 解決報錯問題,修改會Xcode7之前


螢幕快照 2016-09-20 下午12.19.35.png
坑5: command +/注釋失效很簡單 ,跟大象放冰箱一樣,分3步~1.開啟終端2.輸入sudo /usr/libexec/xpccachectl 3.重啟電腦
  坑6: 列印了一大堆0 1 的東西  2016-09-21 17:46:03.253708 HadesSDK[5866:213539] subsystem:   com.apple.BackBoardServices.fence, category: App, enable_level: 1,   persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0,   generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0,   enable_private_data: 0  Produce -Scheme-Edit  Scheme  Environment Variables 裡輸入Key -Value  OS_ACTIVITY_MODE : disable

784630-221d947d657ff45f.png



文/L檸_檬(簡書作者)
原文連結:http://www.jianshu.com/p/789e4d39e7b8
著作權歸作者所有,轉載請聯絡作者獲得授權,並標註“簡書作者”。

iOS10你掉坑了嗎?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.