1.command 鍵加/ 的快捷鍵失靈問題?
處理辦法: 在終端輸入 sudo /usr/libexec/xpccachectl 讓后重新電腦即可
2.模擬器的添加和刪除?
處理辦法:直接到 Windows --> Devices, 看到左下角添加模擬
3.打印一堆沒有的信息
iOS 10真機(jī)調(diào)試的話篙贸,會屏蔽掉NSLog投队。如果NSLog宏定義是這樣的話:
#define NSLog(format, ...) NSLog(format, ## __VA_ARGS__)
在完成OS_ACTIVITY_MODE設(shè)置后會發(fā)現(xiàn)真機(jī)調(diào)度時NSLog不輸出了。
所以需要定義成另一個函數(shù)來輸出爵川,例如 fprintf
#ifdef DEBUG
#define NSLog(FORMAT, ...) fprintf(stderr, "[%s:%d行] %s\n", [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(FORMAT, ...) nil
#endif
注意:在使用這個宏定義的時候要導(dǎo)入
foundation 和UIkit
4.代碼注解的快捷鍵是 option 鍵加 command 鍵 加 /
這地方可以設(shè)置對應(yīng)的默認(rèn)快捷鍵
5.隱藏狀態(tài)欄的功能壞掉了
升級到 iOS 10.0后敷鸦,在查看全屏圖片的時候,需要在 Present 之前給要 present 的 view controller 設(shè)置 modalPresentationCapturesStatusBarAppearance = true寝贡。
6.推送的改變
Xcode 8 后扒披,推送可能出現(xiàn)莫名的bug , 但其中有一點(diǎn)可以看看這個開關(guān)是否打開,一定要記得打開圃泡!
另外通知從手機(jī)上看確實(shí)在 iOS 10 改變了好多碟案,更好用啦;而我還是先收集下相關(guān)資源:
活久見的重構(gòu) - iOS 10 UserNotifications 框架解析
WWDC2016 Session筆記 - iOS 10 推送Notification新特性
7.添加了很多的隱私權(quán)限的設(shè)置
所以我們需要在info plist 中添加描述信息 ?對應(yīng)的描述信息如下
NSBluetoothPeripheralUsageDescription //訪問藍(lán)牙
NSCalendarsUsageDescription //訪問日歷
NSCameraUsageDescription //相機(jī)
NSContactsUsageDescription //通訊錄
NSHealthShareUsageDescription // 訪問健康分享
NSHealthUpdateUsageDescription // 訪問健康更新
NSHomeKitUsageDescription //HomeKit
NSLocationAlwaysUsageDescription // 始終訪問位置
NSLocationWhenInUseUsageDescription //在使用期間訪問位置
NSMicrophoneUsageDescription // 麥克風(fēng)
NSMotionUsageDescription // 訪問運(yùn)動與健身
NSPhotoLibraryUsageDescription // 相冊
NSRemindersUsageDescription // 訪問提醒事項(xiàng)
NSSiriUsageDescription? // Siri
NSSpeechRecognitionUsageDescription //語音識別
NSVideoSubscriberAccountUsageDescription // 視頻這塊的認(rèn)證
NSVoIPUsageDescription // VoIP通話
8.代碼對齊的快捷鍵
在 Filter 搜索 Re-Indent颇蜡,在結(jié)果的 Key 一欄里輸入想要自定義的快捷鍵价说,沒有沖突后保存即可
推薦設(shè)置為 command 加 =
9.代碼塊的生成
1.選擇 Code Snippets區(qū)域中
2.設(shè)置
變量輸入的格式為:<#變量名稱#>
10.Xcode 8 支持的版本
目前Xcode 8 支持的最低按版本是 8.1