今天刚升级到Xcode8,先运行项目跑了一下,果不其然苹果又偷偷修改东西了,在网上查了一下,苹果强制要求APP访问用户信息必须添加安全提示否则会直接崩溃。
1.权限问题
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
这个就是我点击相册的时候的崩溃信息。
根据提示我们在plist文件下添加:
相机 NSCameraUsageDescription type:string
相册 NSPhotoLibraryUsageDescription type:string
通讯录 NSContactsUsageDescription type:string
麦克风 NSMicrophoneUsageDescription type:string
2.UIWebView的加载失败回调error的修饰关键字取消了
//加载失败
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
现在取消了error的修饰关键字,要不然会直接爆红
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
3.证书问题
如图证书管理有些改进,现在有两种方式:1.自动证书管理 2.原来的老方法不过我们可以直接在General下修改,不用去Build Settings下找了,当然你想的话也是可以的。
自动管理证书要在偏好设置里添加苹果账号,会自动生成appId,描述文件,证书。
我在网上还看到其他的问题,如label不能显示全,xib界面调整,注释不能使用等,大家可以找度娘。