当我从itunes获取产品列表时,使用以下方法连接我的应用内购买应用。
- (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 SKProduct:0x7343d50
请帮忙
答案 0 :(得分:1)
Navi试试这个。检查注释行之间的代码
- (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;
}