1:打印的相关
2017-02-11 10:33:22.289934 XMM[769:23111] [SDKLibrary] Not authorized, skipping filter predicate application
2017-02-11 10:33:22.316 XMM[769:23111] year=2017 month =2 day=11
2017-02-11 10:33:22.317 XMM[769:23111] modeCount=0 5
2017-02-11 10:33:22.388728 XMM[769:23155] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-02-11 10:33:22.395042 XMM[769:23155] [] ____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed
2017-02-11 10:33:22.395748 XMM[769:23155] [] __nwlog_err_simulate_crash simulate crash failed "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-02-11 10:33:22.397328 XMM[769:23155] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.30.16
0 libsystem_network.dylib 0x0000000115341666 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x0000000115b3c006 nw_socket_add_input_handler + 3164
2 libnetwork.dylib 0x0000000115b19555 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000115b18572 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000115b17298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x0000000115b32ae1 nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x0000000115b32510 nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x0000000115b4a1f9 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x00000001150be978 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001150e80cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x00000001150c5e17 _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x00000001150c6b4b _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x00000001150c9385 _dispatch_root_queue_drain + 720
13 libdispatch.dylib 0x00000001150c9059 _dispatch_worker_thread3 + 123
14 libsystem_pthread.dylib 0x00000001155744de _pthread_wqthread + 1129
15 libsystem_pthread.dylib 0x0000000115572341 start_wqthread + 13
2017-02-11 10:33:22.480 XMM[769:23111] ------ok
2017-02-11 10:33:25.437395 XMM[769:23153] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/user/Library/Developer/CoreSimulator/Devices/782B3AB9-B226-46FB-A70B-802CEE048CD0/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-02-11 10:33:25.438011 XMM[769:23153] [MC] Reading from private effective user settings.
解决方案:
2017-02-22 18:09:11.687139 NSURLSessionTest[1627:136135] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-02-22 18:09:11.687754 NSURLSessionTest[1627:136135] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-02-22 18:09:11.690138 NSURLSessionTest[1627:136135] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-02-22 18:09:11.693879 NSURLSessionTest[1627:136136] [] nw_host_stats_add_src recv too small, received 24, expected 28
解决方法根第一个一样
3.升级Xcode8之后,会打印一些烦人的Log信息,隐藏不需要的Xcode8日志,
解决的办法:就是设置 OS_ACTIVITY_MODE = disable,这样做在模拟器上是正常的,但是iOS10真机测试所有的Log日志全部被屏蔽了!这不是之前设置导致的,而是iOS10为了在真机上提高性能,所以把Log日志给屏蔽了。
解决方案:
自定义Log 需要用printf()进行转换,真机才能输出日志
// 可以输出纯净的内容:NSLog去掉时间戳及其他输出样式
#ifdef DEBUG
#define NNSLog(FORMAT, ...) fprintf(stderr,"%s\n",[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NNSLog(...)
#endif
// 我推荐用这个打印我们的日志:功能、行数
#ifdef DEBUG
#define NSSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSSLog(...)
#endif
3.报错:-[__NSCFNumber length]: unrecognized selector sent to instance
解决方案:
这个问题大部分是类型转换错误,检查起来可能比较麻烦,个人聚的最好的办法就是一个一个的控制器注释,这样查找问题也快很多