我得到“无效的投影类型nsmutablearray键入skproduct”错误..当我尝试将产品添加到我的uitableview ..这里是我使用的代码...无效的投射类型nsmutablearray类型skproduct - ios
初始化
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];
......
}
什么是我的错误?谢谢..
我无法使用您的示例在我的机器上复制它。尝试一个干净的重建。 – CodaFi 2013-02-20 18:23:15