ksvc/ksyhttpcache_ios

crash in [NSNumber parseString:intoUInt64:]

ycace opened this issue · 5 comments

ycace commented

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSNumber parseString:intoUInt64:]: unrecognized selector sent to class 0x112ab1320'
*** First throw call stack:
(
0 CoreFoundation 0x00000001131e634b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000112c4e21e objc_exception_throw + 48
2 CoreFoundation 0x0000000113255e74 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000011316bc15 forwarding + 1013
4 CoreFoundation 0x000000011316b798 _CF_forwarding_prep_0 + 120
5 YCVideo 0x000000011015b55c -[HTTPConnection parseRangeRequest:withContentLength:] + 825
6 YCVideo 0x000000011015c3c2 -[HTTPConnection sendResponseHeadersAndBody] + 263
7 YCVideo 0x000000011015f819 __55-[HTTPConnection responseHasAvailableData:contentInfo:]_block_invoke + 371
8 libdispatch.dylib 0x000000011432a980 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001143540cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000114331e6b _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x0000000114332b9f _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x00000001143353b7 _dispatch_root_queue_drain + 720
13 libdispatch.dylib 0x000000011433508b _dispatch_worker_thread3 + 123
14 libsystem_pthread.dylib 0x00000001147035a2 _pthread_wqthread + 1299
15 libsystem_pthread.dylib 0x000000011470307d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

在Build Settings下的Other Linker Flags里加上$(inherited)就OK了

ycace commented

@daliang0101 好像没有起到作用, 我把KSYHTTPCache.framework作为一个pod的依赖库,本身pod就会在Other Linker Flags中加上$(inherited)参数,我直接写了这个方法的分类临时解决了这一问题

ycace commented

建议在公开的头文件中暴露这个分类方法的声明

-ObjC,all_load,-force_load这些参数都有吗,你可以先试一下,我们这边自己的demo只有一个$(inherited)就行了

ycace commented

👌 是我忽略了podspec的配置也需要改,加上这个就可以解决问题了
s.xcconfig={'OTHER_LDFLAGS' => '-ObjC'}
谢谢!