Some of the problems encountered Xcode8

After 1.Xcode8 run the project, the console print a bunch of things;

Solution: Select Xcode -> Product -> Scheme -> Edit Scheme or press command + <shortcut, the pop-up window to add the key under the Environment Variables key: OS_ACTIVITY_MODE
value:Disable

Note: The device debugging output NSlog not, so I'm real machine debugging time, remove the checkmark here, just fine.

2. Upgrade the existing certificate after iOS10 original project real machine does not run up. Given as follows:
Signing for "XXXX" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0

Automatically manage signing is enabled by default, you can turn off and on (certificates configured to be selected).


3. Xcode8 run the project on a real machine, turn on the camera album function, program crashes;
Solution: To access the private data project, you need to add these permissions info.plist in:
Camera permission NSCameraUsageDescriptioncameraDesciption
Album permission NSPhotoLibraryUsageDescriptionphotoLibraryDesciption
注:NSPhotoLibraryUsageDescriptionApp需要您的同意,才能访问相册NSCameraUsageDescriptionApp需要您的同意,才能访问相机NSMicrophoneUsageDescriptionApp需要您的同意,才能访问麦克风NSLocationUsageDescriptionApp需要您的同意,才能访问位置NSLocationWhenInUseUsageDescriptionApp需要您的同意,才能在使用期间访问位置NSLocationAlwaysUsageDescriptionApp需要您的同意,才能始终访问位置NSCalendarsUsageDescriptionApp需要您的同意,才能访问日历NSRemindersUsageDescriptionApp需要您的同意,才能访问提醒事项NSMotionUsageDescriptionApp需要您的同意,才能访问运动与健身NSHealthUpdateUsageDescriptionApp需要您的同意,才能访问健康更新NSHealthShareUsageDescriptionApp需要您的同意,才能访问健康分享NSBluetoothPeripheralUsageDescriptionApp需要您的同意,才能访问蓝牙NSAppleMusicUsageDescriptionApp需要您的同意,才能访问媒体资料库

4.UIApplication对象中openUrl被废弃
在iOS 10以前,我们要想使用应用程序去打开一个网页或者进行跳转,直接使用[[UIApplication sharedApplication] openURL 方法就可以了,但是在iOS 10 已经被废弃了,因为使用这种方式,处理的结果我们不能拦截到也不能获取到,对于开发是非常不利的,在iOS 10全新的退出了 [[UIApplication sharedApplication] openURL:nil options:nil completionHandler:nil];有一个成功的回调block 可以进行监视。
注:仍然可以用,只不过会出现警告

5.代码注释不能用解决方法:
打开终端,命令运行: sudo /usr/libexec/xpccachectl然后必须重启电脑后生效。


6.系统判断失效
现在改用:
#define IOS10_OR_LATER  ([[[UIDevice currentDevice] systemVersion] compare"10.0" options:NSNumericSearch] !=NSOrderedAscending)


Guess you like

Origin blog.csdn.net/maolianshuai/article/details/52911016