我在 InApp 过程中遇到异常。我在 Unity3d 4.3 for iOS 中使用 Prime31 插件。
出现成功弹出窗口后几秒钟后发生异常。
这是来自 XCode 的错误声明
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' setObjectForKey: key cannot be nil'
堆栈跟踪:
*** First throw call stack:
(0x2f7ddf53 0x39bb46af 0x2f719727 0x1c4bf95 0x31ee50ff 0x3a097d7b 0x3a097d67 0x3a09e7c1 0x2f7a8821 0x2f7a70f5 0x2f711ce7 0x2f711acb 0x34432283 0x31fb3a41 0x8b4c 0x8a28)
libc++abi.dylib: terminating with uncaught exception of type NSException
* thread #1: tid = 0x26867, 0x3a1731fc libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x3a1731fc libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x3a1dca32 libsystem_pthread.dylib`pthread_kill + 58
frame #2: 0x3a123ffc libsystem_c.dylib`abort + 76
frame #3: 0x39453cd6 libc++abi.dylib`abort_message + 74
frame #4: 0x3946c6e4 libc++abi.dylib`default_terminate_handler() + 252
frame #5: 0x39bb4920 libobjc.A.dylib`_objc_terminate() + 192
frame #6: 0x3946a1c6 libc++abi.dylib`std::__terminate(void (*)()) + 78
frame #7: 0x39469a1c libc++abi.dylib`__cxa_throw + 116
frame #8: 0x39bb4782 libobjc.A.dylib`objc_exception_throw + 250
frame #9: 0x2f719726 CoreFoundation`-[__NSDictionaryM setObject:forKey:] + 818
frame #10: 0x01c4bf94 APPNAME`+[ApStore productsRequest:didReceiveResponse:] + 376
frame #11: 0x31ee50fe StoreKit`__34-[SKProductsRequest _handleReply:]_block_invoke + 466
frame #12: 0x3a097d7a libdispatch.dylib`_dispatch_call_block_and_release + 10
frame #13: 0x3a097d66 libdispatch.dylib`_dispatch_client_callout + 22
frame #14: 0x3a09e7c0 libdispatch.dylib`_dispatch_main_queue_callback_4CF$VARIANT$mp + 268
frame #15: 0x2f7a8820 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
frame #16: 0x2f7a70f4 CoreFoundation`__CFRunLoopRun + 1300
frame #17: 0x2f711ce6 CoreFoundation`CFRunLoopRunSpecific + 522
frame #18: 0x2f711aca CoreFoundation`CFRunLoopRunInMode + 106
frame #19: 0x34432282 GraphicsServices`GSEventRunModal + 138
frame #20: 0x31fb3a40 UIKit`UIApplicationMain + 1136
frame #21: 0x00008b4c APPNAME`main(argc=1, argv=0x27dffc68) + 288 at main.mm:28
frame #22: 0x00008a28 APPNAME`start + 40
从错误语句来看,似乎一个空键正在传递给字典,但我找不到确切的位置以及我做错了什么。