我在应用程序内部使用libPhoneNumber-iOS(0.9.13),但是在运行该代码段时,应用程序在第二条指令上崩溃:

let helper = NBMetadataHelper()
let dict = helper.cCode2CNMap()


错误堆栈如下:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NBMetadataHelper CCode2CNMap]: unrecognized selector sent to instance 0x600000427500'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e48a12b __exceptionPreprocess 171
1 libobjc.A.dylib 0x000000010cb38f41 objc_exception_throw 48
2 CoreFoundation 0x000000010e50b024 -[NSObject(NSObject) doesNotRecognizeSelector:] 132
3 CoreFoundation 0x000000010e40cf78 ___forwarding___ 1432
4 CoreFoundation 0x000000010e40c958 _CF_forwarding_prep_0 120


有人可以给我一些提示吗?

最佳答案

库已更改,请从此更新代码:

let helper = NBMetadataHelper.cCode2CNMap()
let dict = helper.cCode2CNMap()


对此:

let dict = NBMetadataHelper.cCode2CNMap()

10-01 21:34