在应用程序购买不工作

问题描述:

我使用本教程 http://www.raywenderlich.com/ 2797 /应用内购买介绍,用于在我的应用中创建购买。

I use this tutorial http://www.raywenderlich.com/2797/introduction-to-in-app-purchases for create purchases in my app.

此代码有效或无效。我知道这听起来很有趣,但这是我的问题。

From time to time this code is working or not working. I know it sounds funny, but this is my problem.

例如:首先启动应用程序(所有项目下载并在表格中显示,我可以购买任何此类),但在下一次(例如第二次开始)我在这一行收到错误:

For example: First start app (all items download and shows in table and i have available to purchase any of this), but at the next time (for example second start) I get an error on this line:

SKProduct *product = [[InAppRageIAPHelper sharedHelper].products objectAtIndex:0]; 

错误是


由于未捕获的异常'NSRangeException'索引0超出空数组的边界而终止应用程序

Terminating app due to uncaught exception 'NSRangeException' index 0 beyond bounds for empty array


在我的设备进行硬重置后,我解决了这个问题。

This problem I solved after make hard reset for my device.