我收到“invalid cast type nsmutablearray to type skproduct”错误..当我尝试将产品添加到我的 uitableview 时..这是我正在使用的代码...
在里面
SKProduct *product1 = [[InAppPurchaseManager sharedInAppManager] getLevelUpgradeProduct];
SKProduct *product2 = [[InAppPurchaseManager sharedInAppManager] getPlayerUpgradeOne];
SKProduct *product3 = [[InAppPurchaseManager sharedInAppManager] getPlayerUpgradeTwo];
_products = [[[NSMutableArray alloc] initWithObjects:product1, product2, product3, nil] autorelease];
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
......
SKProduct *product = (SKProduct*) _products[indexPath.row]; // error
cell.textLabel.text = product.localizedTitle;
[_priceFormatter setLocale:product.priceLocale];
cell.detailTextLabel.text = [_priceFormatter stringFromNumber:product.price];
......
}
我的错误是什么?谢谢..