稍后启动SKProductsRequest会给出 - [_ NSCFArray length]无效的选择器错误。 LoadMicroPaymentsProductsOperation错误 [英] Starting a SKProductsRequest gives -[_NSCFArray length] invalid selector error a moment later. LoadMicroPaymentsProductsOperation error

查看:247
本文介绍了稍后启动SKProductsRequest会给出 - [_ NSCFArray length]无效的选择器错误。 LoadMicroPaymentsProductsOperation错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的服务器获取标识符列表,然后在产品请求中将它们传递给Apple。这是我的代码,下面是我得到的错误。
发生这种情况时,iPhone 4不会崩溃。

I'm fetching a list of identifiers from my server, then passing them off in a products request to Apple. Here's my code, and below is the error I'm getting. The iPhone 4 is not crashing when this happens.

-(void)didReceiveData:(NSArray *)data {
NSLog(@"Received Identifiers: %@",data);
NSSet *productIdentifiers = [NSSet setWithArray:data];
SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers]; 
productsRequest.delegate = self;
[productsRequest start];
NSLog(@"productsRequest should have started by now");
}


  Wed Dec 29 09:42:14 iPhone XXXX-iphone[6363] <Warning>: Received Identifiers: (
        (
        1,
        10,
        "com.XXXX.XXXX.10"
    )
)


 Wed Dec 29 09:42:14 iPhone XXXX-iphone[6363] <Warning>: productsRequest should have started by now

Wed Dec 29 09:42:18 iPhone itunesstored [6367]: - [__ NSCFArray length]:无法识别的选择器发送到实例0x119070

Wed Dec 29 09:42:18 iPhone itunesstored[6367] : -[__NSCFArray length]: unrecognized selector sent to instance 0x119070

Wed Dec 29 09:42:18 iPhone itunesstored [ 6367]:抓 - [__ NSCFArray长度]:无法识别的选择发送到实例0x119070例外与堆栈跟踪:(0x33ac0975 0x3347b49d 0x33ac2133 0x33a69aa9 0x33a69860 0x2717b 0x27515 0x31469651 0x314693ed 0x31469e39 0x3362795f 0x336276c3 0x3363c4eb 0x33c32680 0x33c32ba0 0x33bd7251 0x33bcf978)

Wed Dec 29 09:42:18 iPhone itunesstored[6367] : caught -[__NSCFArray length]: unrecognized selector sent to instance 0x119070 exception with stack trace: (0x33ac0975 0x3347b49d 0x33ac2133 0x33a69aa9 0x33a69860 0x2717b 0x27515 0x31469651 0x314693ed 0x31469e39 0x3362795f 0x336276c3 0x3363c4eb 0x33c32680 0x33c32ba0 0x33bd7251 0x33bcf978)

推荐答案

从日志输出中,我猜数据是一个数组数组。

From your log output, I guess data is an array of arrays.

您应该只将一个NSString(您的产品ID)数组传递给 setWithArray:

You should pass only an array of NSString (your product ids) to setWithArray:

这篇关于稍后启动SKProductsRequest会给出 - [_ NSCFArray length]无效的选择器错误。 LoadMicroPaymentsProductsOperation错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆