2013-07-18 74 views
0

當我從iTunes下載產品列表時,請使用以下方法在我的應用購買應用中連接。將編碼字符串轉換爲ios中的正常字符串?

- (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出是繼

納文= 0 SKProduct:0x7343d50

請幫

+0

嘗試'NSLog(@「naveen = 0%@」,[skProducts objectAtIndex:0]);' – Buntylm

+0

好吧,讓我試試.i會讓你讀取結果 – Navi

+2

@bit-whacker爲什麼你認爲會幫幫我?它是一樣的... – 2013-07-18 05:53:23

回答

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; 

} 
+0

酷它爲我工作 – Navi

相關問題