坑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
著作權歸作者所有,轉載請聯系作者獲得授權,並標注“簡書作者”。
原文鏈接:http://www.jianshu.com/p/789e4d39e7b8
著作權歸作者所有,轉載請聯系作者獲得授權,並標注“簡書作者”。