Apple は、アプリ内購入がある最初のアプリを承認しましたが、ユーザーが「アップグレード」ボタンをタップすると、突然、アプリが一時的にハングアップしてからクラッシュします。XCode のオーガナイザーのコンソール機能を使用して、次のレポートを取得できました。
Sep 18 15:12:48 iPad MyApp[53107] <Error>: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(0x316f92a3 0x3958497f 0x31643e8d 0x54b23 0x335ec0c5 0x335ec077 0x335ec055 0x335eb90b 0x335ebe01 0x335145f1 0x33501801 0x3350111b 0x351f35a3 0x351f31d3 0x316ce173 0x316ce117 0x316ccf99 0x3163febd 0x3163fd49 0x351f22eb 0x33555301 0x4b81f 0x399bbb20)
Sep 18 15:12:48 iPad ReportCrash[53109] <Notice>: Formulating crash report for process MyApp[53107]
Sep 18 15:12:48 iPad com.apple.launchd[1] (UIKitApplication:com.mycompany.MyApp[0x716c][53107]) <Warning>: (UIKitApplication:com.mycompany.MyApp[0x716c]) Job appears to have crashed: Abort trap: 6
Sep 18 15:12:48 iPad ReportCrash[53109] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Sep 18 15:12:48 iPad backboardd[26] <Warning>: Application 'UIKitApplication:com.mycompany.MyApp[0x716c]' exited abnormally with signal 6: Abort trap: 6
Sep 18 15:12:48 iPad ReportCrash[53109] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/MyApp_2013-09-18-151248_iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
これは、自分のデバイスでアプリを実行した場合には発生しません。Apple がアプリをレビューしたときに機能していたに違いありません。
私の製品配列がnullであり、購入しようとすると_products[0]
(利用可能な唯一のもの)がクラッシュすると思います。
詳細情報:アプリ内購入を追加するときは、 Ray Wenderlich のチュートリアルに 従いました。
[[AppStoreHelper sharedInstance] requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) {
if (success) {
_products = products;
}
[refreshControl endRefreshing];
}];
要約すると、なぜテストモードでしか機能しないのですか?
前もって感謝します!