1

我得到了这个例外:

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

因为产品似乎是零。这是我将产品对象放在一起的方式:

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

- (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

而且我真的不明白他们如何创建看起来像是空的产品对象。但是当它为空时,它会给出一个异常。

有什么我没有做的吗?谢谢!

4

0 回答 0