ios inapp购买 - 因为产品无法识别而获得例外

时间:2013-08-07 02:50:13

标签: ios ios6

我得到了这个例外:

2013-08-06 21:48:05.046 entrepreneur[13200:11f03] Not purchased: 1
2013-08-06 21:48:09.075 entrepreneur[13200:11f03] Buying (null)...
2013-08-06 21:48:09.077 entrepreneur[13200:11f03] Buying (null)...
2013-08-06 21:48:09.079 entrepreneur[13200:11f03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid product identifier: (null)'
*** First throw call stack:
(0x1691012 0x1123e7e 0x1690deb 0x3c7dc 0x18d5f 0x1a4be 0x1137705 0x6e920 0x6e8b8 0x12f671 0x12fbcf 0x12ed38 0x9e33f 0x9e552 0x7c3aa 0x6dcf8 0x14dbdf9 0x14dbad0 0x1606bf5 0x1606962 0x1637bb6 0x1636f44 0x1636e1b 0x14da7e3 0x14da668 0x6b65c 0x2a1d 0x2945)
libc++abi.dylib: terminate called throwing an exception

因为该产品似乎是零。以下是我将产品对象放在一起的方法:

这是调用“subscribe”按钮时调用的方法:

- (IBAction)subscribe:(id)sender
{
    UIButton *buyButton = (UIButton *)sender;
    SKProduct *product = _products[buyButton.tag];

    NSLog(@"Buying %@...", product.productIdentifier);
    [[RageIAPHelper sharedInstance] buyProduct:product];
}

我正在使用本教程: http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial

我真的不明白他们是如何创建产品对象的,似乎它是空的。但是当它为空时,它会给出一个例外。

我在这里做的不是很正确吗? 谢谢!

0 个答案:

没有答案