0

当我从 iTunes Connect 中获取产品列表时,我的应用内购买应用程序正在使用以下方法。

   - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {

    NSLog(@"Loaded list of products...");
    _productsRequest = nil;

    NSArray * skProducts = response.products;
    NSLog(@"naveen =0%@",skProducts[0]);
    for (SKProduct * skProduct in skProducts) {
        NSLog(@"Found product: %@ %@ %0.2f",
              skProduct.productIdentifier,
              skProduct.localizedTitle,
              skProduct.price.floatValue);
    }

    _completionHandler(YES, skProducts);
    _completionHandler = nil;

}

在这种方法中,我尝试使用NSLog(@"naveen =0%@",skProducts[0]);

我对这个 NSLog 的关注如下

naveen = 0 SK产品:0x7343d50

请帮忙

4

1 回答 1

1

Navi Try this .Check code between comment lines

   - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {

    NSLog(@"Loaded list of products...");
    _productsRequest = nil;

    NSArray * skProducts = response.products;
   ////////////////////////////////////////  EDIT //////////////////////////////
    SKProduct * product = (SKProduct *)skProducts[0];

     NSLog(@"naveen =0%@",product.localizedTitle);
   ////////////////////////////////////////////////////////////////////////////
    for (SKProduct * skProduct in skProducts) {
        NSLog(@"Found product: %@ %@ %0.2f",
              skProduct.productIdentifier,
              skProduct.localizedTitle,
              skProduct.price.floatValue);
    }

    _completionHandler(YES, skProducts);
    _completionHandler = nil;

}
于 2013-07-18T06:08:03.033 回答