【1】、Xcode8代碼出現ubsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0 2016-09-14 17:18:55.843428 MyApp[6880:340837]
解決辦法:【product】-【scheme】-【Edit Scheme】-【Run】-【Argument】-【Environment Variable】添加keyValue【OS_ACTIVITY_MODE disable】可以停止輸出打印此日志
遺留問題:還會出現Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x10a39a910) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x10a1c4210). One of the two will be used. Which one is undefined.
【2】MJRefresh出現崩潰現象
解決辦法:類庫增加判斷
if (range.location != NSNotFound) { language = [language substringToIndex:range.location]; }
【3】iOS10字體隱藏問題
label的話寫一個擴展類
@implementation UILabel (Extend) - (void)lableAdaptIOS10{ CGFloat iOS10 = [[UIDevice currentDevice] systemVersion].floatValue >= 10; if (iOS10) { // self UIFont 的preferredFontForTextStyle: 意思是指定一個樣式,並讓字體大小符合用戶設定的字體大小。 [self sizeToFit]; // self.font =[UIFont preferredFontForTextStyle: UIFontTextStyleHeadline]; //是否更新字體的變化 // self.adjustsFontForContentSizeCategory = YES; } }
[4] StroyBoard問題
<1>Xcode 打開SB頻繁出現崩潰現象
<2>Xcode 打開SB后 約束出現大量警告⚠️
【5】Xcode8注釋失效
打開終端,命令運行: sudo /usr/libexec/xpccachectl 重啟電腦
[6] Xcode7 8兼容問題
This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8.0 or later.
刪除SB中代碼:
【7】Xcode8不能真機打印log問題
#ifdef DEBUG #define HYString [NSString stringWithFormat:@"%s", __FILE__].lastPathComponent #define HYLog(...) printf("%s 第%d行: %s\n\n", [HYString UTF8String] ,__LINE__, [[NSString stringWithFormat:__VA_ARGS__] UTF8String]); #else #define HYLog(...) #endif
【8】Xcode SVN 更新 報錯 The server certificate failed to verify.
解決辦法:1、svn ls xxxxxx(SVN地址)
2、期間可能需要輸入SVN用戶名和密碼,然后p即可
【9】iOS10 隱私權限問題(不加可能導致崩潰)
<key>NSCameraUsageDescription</key> <string>親,我們要打開你的相機!</string> <key>NSContactsUsageDescription</key> <string>親,我們要打開你的通信錄!</string> <key>NSLocationAlwaysUsageDescription</key> <string>為方便使用地圖功能,請您允許定位!</string> <key>NSPhotoLibraryUsageDescription</key> <string>親,我們要打開你的相冊!</string>
【10】iOS10 消息推送(推送有提醒,消息收不到)
解決辦法:更新三方sdk吧,都有方案
iOS10 Xcode8 【以極光舉例 其他都差不多】 設置:
iOS10新增framework:
iOS10新增接收通知方法:
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler { NSDictionary * userInfo = notification.request.content.userInfo; - (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler {
iOS7 < iOS系統< iOS 10通知接收方法
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
iOS6以及之前接收通知方法
- (void)application:(UIApplication *)application didReceiveRemoteNotification: (NSDictionary *)userInfo {
【11】Xcode8 真機運行錯誤
Development cannot be enabled while your device is locked.Please unlock your device and reattach.(0xE80000E2
重新退出Xcode,再真機運行即可!
[12] macOS Sierra 系統下上傳包錯誤
Xcode7.3.1打包 macOS Sierra 系統下 使用application loader上傳包 出現錯誤 ERROR ITMS - 90167 No. app bundles found in the package
解決辦法:使用其他版本的系統(例如10.11.6之前版本)。
【13】無限卡住Setting up CocoaPods master repo
1、cd ~/.cocoapods/repos
2、git clone https://github.com/CocoaPods/Specs master
【14】macOS Sierra安裝mac軟件出現文件損壞
解決辦法:打開終端輸入 sudo spctl --master-disable 即可