iOS10 Xcode8问题汇总

本文总结了iOS10与Xcode8环境下常见的技术难题及应对策略,包括代码日志输出异常、MJRefresh崩溃、字体显示问题、Storyboard故障等,还涉及了Xcode8真机调试、SVN更新证书验证失败、iOS10隐私权限声明及推送通知适配等问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自:http://www.cnblogs.com/superbobo/p/5873930.html

iOS10 Xcode8问题汇总

【1】、Xcode8代码出现ubsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0 2016-09-14 17:18:55.843428 MyApp[6880:340837]

解决办法:【product】-【scheme】-【Edit Scheme】-【Run】-【Argument】-【Environment Variable】添加keyValue【OS_ACTIVITY_MODE   disable】可以停止输出打印此日志

遗留问题还会出现Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x10a39a910) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x10a1c4210). One of the two will be used. Which one is undefined.

【2】MJRefresh出现崩溃现象

 解决办法:类库增加判断

1
2
3
if  (range.location !=  NSNotFound ) {
             language = [language substringToIndex:range.location];
}   

【3】iOS10字体隐藏问题

label的话写一个扩展类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
@implementation  UILabel (Extend)
 
- ( void )lableAdaptIOS10{
 
     CGFloat iOS10 = [[UIDevice currentDevice] systemVersion].floatValue >= 10;
     if  (iOS10) {
//        self    UIFont 的preferredFontForTextStyle: 意思是指定一个样式,并让字体大小符合用户设定的字体大小。
         [ self  sizeToFit];
 
//      self.font =[UIFont preferredFontForTextStyle: UIFontTextStyleHeadline]; 
         //是否更新字体的变化
//        self.adjustsFontForContentSizeCategory = YES;
     }
}

 [4] StroyBoard问题

<1>Xcode 打开SB频繁出现崩溃现象

<2>Xcode 打开SB后 约束出现大量警告⚠️

【5】Xcode8注释失效

打开终端,命令运行: sudo /usr/libexec/xpccachectl 重启电脑

 [6] Xcode7 8兼容问题

This version does not support documents saved in the Xcode 8 format. Open this document with Xcode 8.0 or later.

删除SB中代码:

【7】Xcode8不能真机打印log问题

1
2
3
4
5
6
7
#ifdef DEBUG
#define HYString [NSString stringWithFormat:@"%s", __FILE__].lastPathComponent
#define HYLog(...) printf("%s 第%d行: %s\n\n", [HYString UTF8String] ,__LINE__, [[NSString stringWithFormat:__VA_ARGS__] UTF8String]);
 
#else
#define HYLog(...)
#endif

 【8】Xcode SVN 更新 报错 The server certificate failed to verify.

   解决办法:1、svn ls xxxxxx(SVN地址)

        2、期间可能需要输入SVN用户名和密码,然后p即可

 【9】iOS10 隐私权限问题(不加可能导致崩溃)

1
2
3
4
5
6
7
8
     <key> NSCameraUsageDescription </key>
<string>亲,我们要打开你的相机!</string>
<key> NSContactsUsageDescription </key>
<string>亲,我们要打开你的通信录!</string>
<key> NSLocationAlwaysUsageDescription </key>
<string>为方便使用地图功能,请您允许定位!</string>
<key> NSPhotoLibraryUsageDescription </key>
<string>亲,我们要打开你的相册!</string>       

 【10】iOS10 消息推送(推送有提醒,消息收不到)

解决办法:更新三方sdk吧,都有方案

iOS10 Xcode8 【以极光举例  其他都差不多】 设置:

 

 

iOS10新增framework:

iOS10新增接收通知方法:

1
2
3
4
- ( void )jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:( void  (^)( NSInteger ))completionHandler {
     NSDictionary  * userInfo = notification.request.content.userInfo;
 
- ( void )jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:( void  (^)())completionHandler {

 iOS7 < iOS系统< iOS 10通知接收方法

1
- ( void )application:(UIApplication *)application didReceiveRemoteNotification:( NSDictionary  *)userInfo fetchCompletionHandler:( void  (^)(UIBackgroundFetchResult))completionHandler {

 iOS6以及之前接收通知方法

1
2
- ( void )application:(UIApplication *)application didReceiveRemoteNotification:
( NSDictionary  *)userInfo {

 

【11】Xcode8 真机运行错误

Development cannot be enabled while your device is locked.Please unlock your device and reattach.(0xE80000E2

重新退出Xcode,再真机运行即可!

 [12]  macOS Sierra 系统下上传包错误

Xcode7.3.1打包 macOS Sierra 系统下 使用application loader上传包 出现错误 ERROR ITMS - 90167 No. app bundles found in the package

解决办法:使用其他版本的系统(例如10.11.6之前版本)。

【13】无限卡住Setting up CocoaPods master repo

1、cd ~/.cocoapods/repos

2、git clone https://github.com/CocoaPods/Specs master

【14】macOS Sierra安装mac软件出现文件损坏

解决办法:打开终端输入 sudo spctl --master-disable 即可


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值