ios - iOS 应用程序崩溃报告

标签 ios crash in-app-purchase mkstorekit

我的应用程序中的应用内购买部分遇到问题。该问题仅出现在 iPhone 6、6s 和 iPad Air 上。点击任何应用内购买时,应用程序崩溃。

这是崩溃报告:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 18446744073709551615 beyond bounds for empty array'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010b86ef65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010b241deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010b752a94 -[__NSArrayM objectAtIndex:] + 212
    3   Chubby Vikings Free                 0x0000000106654366 -[MKStoreManager addToQueue:] + 294
    4   Chubby Vikings Free                 0x0000000106653fde __52-[MKStoreManager buyFeature:onComplete:onCancelled:]_block_invoke + 526
    5   Chubby Vikings Free                 0x00000001065ac2ae +[MKSKProduct verifyProductForReviewAccess:onComplete:onError:] + 174
    6   Chubby Vikings Free                 0x0000000106653d46 -[MKStoreManager buyFeature:onComplete:onCancelled:] + 502
    7   Chubby Vikings Free                 0x00000001065d5a79 -[DBPurchaseManager makePurchase:onComplete:onCancel:] + 313
    8   Chubby Vikings Free                 0x00000001065e1fd1 -[vShopCoinsPopup clickCoinsPack1:] + 225
    9   CoreFoundation                      0x000000010b75d85c __invoking___ + 140
    10  CoreFoundation                      0x000000010b75d6ae -[NSInvocation invoke] + 286
    11  Chubby Vikings Free                 0x00000001066a0773 -[CCMenuItem activate] + 67
    12  Chubby Vikings Free                 0x000000010669d80e -[CCMenu ccTouchEnded:withEvent:] + 286
    13  Chubby Vikings Free                 0x00000001066edfae -[CCTouchDispatcher touches:withEvent:withTouchType:] + 1598
    14  Chubby Vikings Free                 0x00000001066eea3e -[CCTouchDispatcher touchesEnded:withEvent:] + 78
    15  Chubby Vikings Free                 0x0000000106670a64 -[CCTouchView touchesEnded:withEvent:] + 84
    16  UIKit                               0x0000000108b67aa3 -[UIWindow _sendTouchesForEvent:] + 835
    17  UIKit                               0x0000000108b68691 -[UIWindow sendEvent:] + 865
    18  UIKit                               0x0000000108b1a752 -[UIApplication sendEvent:] + 263
    19  UIKit                               0x0000000108af5fcc _UIApplicationHandleEventQueue + 6693
    20  CoreFoundation                      0x000000010b79b0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    21  CoreFoundation                      0x000000010b790fcc __CFRunLoopDoSources0 + 556
    22  CoreFoundation                      0x000000010b790483 __CFRunLoopRun + 867
    23  CoreFoundation                      0x000000010b78fe98 CFRunLoopRunSpecific + 488
    24  GraphicsServices                    0x000000010dabbad2 GSEventRunModal + 161
    25  UIKit                               0x0000000108afb676 UIApplicationMain + 171
    26  Chubby Vikings Free                 0x00000001065977c4 main + 100
    27  libdyld.dylib                       0x000000010bd5292d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

最佳答案

数组的大小为零。因此,您尝试调用 [array objectAtIndex:0]。 0 超出了空数组的范围(这并不奇怪——任何东西都超出了空数组的范围)。

关于ios - iOS 应用程序崩溃报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32709677/

相关文章:

CSS3 Transition(供应商前缀)立即使 Safari 崩溃

android - 应用程序因短信监听器而崩溃

ios - 我应该什么时候验证应用内购买交易收据?

objective-c - 苹果操作系统 : In-App Purchase Error Code 0

iphone - 是否可以对应用内购买的内容实现每个 iTunes 帐户的 DRM?

ios - 使用委托(delegate)在 View Controller 之间进行通信

ios - Swift - UICollectionView 在一行中显示多个项目

javascript - Phonegap/Cordova 2.9 自定义插件创建。有工作示例吗?

iphone - 不使用 SalesForce Webview 登录 iOS 上的 SalesForce?

ios - UIActivityViewController 在 Testflight 中崩溃,但在从 Xcode 构建时不会崩溃