Xcode8适配 iOS10新特性

1.Xcode8 :关闭烦人的log日志

解决方式:Xcode ->Product-> Scheme->Edit Scheme中配置OS_ACTIVITY_MODE为disable
Xcode8适配 iOS10新特性_第1张图片
不再爱烦人的 log

2.webView崩溃

-(void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error

解决方式:删除NSError前面的 nullable

3.ATS

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

解决方式:容许支持Http 传输方法
NSAppTransportSecurity
    
NSAllowsArbitraryLoads
      

** NSAppTransportSecurity ——选择AllowArbitrary Loads(容许任意加载) 设置为 YES**

info.plist里添加 ATS支持

附上ATS的合理解释:http://my.oschina.net/vimfung/blog/494687

4.推送失败

场景:Xcode7.3升级Xcode8后推送失败

Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed? or there is no APNs register code? Please refer to JPush docs.

原因:Xcode8推送默认是关闭的需要手动开启
Xcode8适配 iOS10新特性_第2张图片
大家好!我是推送助理:Push Notifications

5.权限配置问题

场景:Xcode8访问媒体库crash

Crash ceason:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSAppleMusicUsageDescription key with a string value explaining to the user how the app uses this data.

解决方式:info.plist添加NSAppleMusicUsageDescription
Xcode8适配 iOS10新特性_第3张图片
info.plist 权限访问设置
  • 媒体库权限:NSAppleMusicUsageDescription 是否允许访问媒体库?

  • 定位权限:Privacy - Location When In Use Usage Description 我们需要通过您的地理位置信息获取您周边的相关数据

  • 定位权限: Privacy - Location Always Usage Description 我们需要通过您的地理位置信息获取您周边的相关数据

  • 相机权限: Privacy - Camera Usage Description 是否允许访问相机?

  • 相册权限: Privacy - Photo Library Usage Description 是否允许访问媒体资料库?

  • 通讯录权限: Privacy - Contacts Usage Description 是否允许访问通讯录?

  • 蓝牙权限:Privacy - Bluetooth Peripheral Usage Description 是否允许使用蓝牙?

  • 日历权限:Privacy - Calendars Usage Description 是否允许使用日历?

未完待续...

你可能感兴趣的:(Xcode8适配 iOS10新特性)