1:打印的相關(guān)
2017-02-1110:33:22.289934XMM[769:23111] [SDKLibrary] Not authorized, skippingfilterpredicate application2017-02-1110:33:22.316XMM[769:23111] year=2017month =2day=112017-02-1110:33:22.317XMM[769:23111] modeCount=052017-02-1110:33:22.388728XMM[769:23155] [] nw_host_stats_add_src recv too small, received24, expected282017-02-1110:33:22.395042XMM[769:23155] [] ____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed2017-02-1110:33:22.395748XMM[769:23155] [] __nwlog_err_simulate_crash simulate crash failed"nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"2017-02-1110:33:22.397328XMM[769:23155] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:? ? ? ? [x86_64] libnetcore-856.30.160libsystem_network.dylib0x0000000115341666 __nw_create_backtrace_string +1231libnetwork.dylib0x0000000115b3c006 nw_socket_add_input_handler +31642libnetwork.dylib0x0000000115b19555 nw_endpoint_flow_attach_protocols +37683libnetwork.dylib0x0000000115b18572 nw_endpoint_flow_setup_socket +5634libnetwork.dylib0x0000000115b17298 -[NWConcrete_nw_endpoint_flow startWithHandler:] +26125libnetwork.dylib0x0000000115b32ae1 nw_endpoint_handler_path_change +12616libnetwork.dylib0x0000000115b32510 nw_endpoint_handler_start +5707libnetwork.dylib0x0000000115b4a1f9 nw_endpoint_resolver_start_next_child +22408libdispatch.dylib0x00000001150be978 _dispatch_call_block_and_release +129libdispatch.dylib0x00000001150e80cd _dispatch_client_callout +810libdispatch.dylib0x00000001150c5e17 _dispatch_queue_serial_drain +23611libdispatch.dylib0x00000001150c6b4b _dispatch_queue_invoke +107312libdispatch.dylib0x00000001150c9385 _dispatch_root_queue_drain +72013libdispatch.dylib0x00000001150c9059 _dispatch_worker_thread3 +12314libsystem_pthread.dylib0x00000001155744de _pthread_wqthread +112915libsystem_pthread.dylib0x0000000115572341 start_wqthread +132017-02-1110:33:22.480XMM[769:23111] ------ok2017-02-1110:33:25.437395XMM[769:23153] [MC] System group containerforsystemgroup.com.apple.configurationprofilespath is /Users/user/Library/Developer/CoreSimulator/Devices/782B3AB9-B226-46FB-A70B-802CEE048CD0/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles2017-02-1110:33:25.438011XMM[769:23153] [MC] Reading from private effective user settings.
解決方案:
14D06F31-A239-4ADC-B44F-8837F1882675.png
2.
2017-02-2218:09:11.687139NSURLSessionTest[1627:136135][]nw_host_stats_add_srcrecvtoosmall,received24,expected282017-02-2218:09:11.687754NSURLSessionTest[1627:136135][]nw_host_stats_add_srcrecvtoosmall,received24,expected282017-02-2218:09:11.690138NSURLSessionTest[1627:136135][]nw_host_stats_add_srcrecvtoosmall,received24,expected282017-02-2218:09:11.693879NSURLSessionTest[1627:136136][]nw_host_stats_add_srcrecvtoosmall,received24,expected28
解決方法根第一個(gè)一樣
3.升級Xcode8之后弥奸,會(huì)打印一些煩人的Log信息承绸,隱藏不需要的Xcode8日志,
解決的辦法:就是設(shè)置 OS_ACTIVITY_MODE = disable勉盅,這樣做在模擬器上是正常的铆农,但是iOS10真機(jī)測試所有的Log日志全部被屏蔽了牺氨!這不是之前設(shè)置導(dǎo)致的,而是iOS10為了在真機(jī)上提高性能墩剖,所以把Log日志給屏蔽了猴凹。
解決方案:
自定義Log 需要用printf()進(jìn)行轉(zhuǎn)換,真機(jī)才能輸出日志
// 可以輸出純凈的內(nèi)容:NSLog去掉時(shí)間戳及其他輸出樣式#ifdefDEBUG#defineNNSLog(FORMAT, ...) fprintf(stderr,"%s\n",[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);#else#defineNNSLog(...)#endif// 我推薦用這個(gè)打印我們的日志:功能岭皂、行數(shù)#ifdefDEBUG#defineNSSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);#else#defineNSSLog(...)#endif
3.報(bào)錯(cuò):-[__NSCFNumber length]: unrecognized selector sent to instance
解決方案:
這個(gè)問題大部分是類型轉(zhuǎn)換錯(cuò)誤郊霎,檢查起來可能比較麻煩,個(gè)人聚的最好的辦法就是一個(gè)一個(gè)的控制器注釋爷绘,這樣查找問題也快很多