最近下载Xcode8 ,把项目适配了一下iOS10 ,把遇到的一些问题记录下来:
1.Xcode8运行项目之后,控制台打印了一堆东西;
去除方法:选择Xcode ->Product ->Scheme -> Edit Scheme 或者按command + shift + < 快捷键,
在弹出的窗口中Environment Variables 下添加 0S_ACTIVITY_MODE=disable
注:真机调试不输出NSlog了,所以我真机调试的时候,把此处对号去除,就好了
2.Xcode8 打开工程后,出现下图,苹果新特性
我勾选了Automatically manage signing,并且选择配置了Team,就好了。
注:或者另外一种方式 点击打开链接
3.用Xcode8 运行项目在真机上,打开相机相册功能,程序崩溃;
解决办法:项目中访问了隐私数据,需要在info.plist中添加这些权限:
相机权限
相册权限
NSPhotoLibraryUsageDescription
App需要您的同意,才能访问相册
NSCameraUsageDescription
App需要您的同意,才能访问相机
NSMicrophoneUsageDescription
App需要您的同意,才能访问麦克风
NSLocationUsageDescription
App需要您的同意,才能访问位置
NSLocationWhenInUseUsageDescription
App需要您的同意,才能在使用期间访问位置
NSLocationAlwaysUsageDescription
App需要您的同意,才能始终访问位置
NSCalendarsUsageDescription
App需要您的同意,才能访问日历
NSRemindersUsageDescription
App需要您的同意,才能访问提醒事项
NSMotionUsageDescription App需要您的同意,才能访问运动与健身
NSHealthUpdateUsageDescription
App需要您的同意,才能访问健康更新
NSHealthShareUsageDescription
App需要您的同意,才能访问健康分享
NSBluetoothPeripheralUsageDescription
App需要您的同意,才能访问蓝牙
NSAppleMusicUsageDescription
App需要您的同意,才能访问媒体资料库
如果没有用,需配置一下
4.字体变大,原有的fream需要适配,智能逐一排查啦
5.Nib问题:警告
- (void)awakeFromNib {
// Initialization code
}
需要添加:
[super awakeFromNib];
#define LIOS10_OR_LATER ([[[UIDevice currentDevice]systemVersion]compare:@"10.0" options:NSNumericSearch] !=NSOrderedAscending)
8.代码注释不能用
Dear developer,
We have discovered one or more issues with your recent delivery for "APPName". To process your delivery, the following issues must be corrected:
This app attempts 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.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team