我格式化ASIHTTPRequest发送阵列数据到服务器。我有一个数组的键(propertyKeys)和一个数组的信息(propertyValues),并创建了一个循环来设置帖子和键值。- [NSURL objectAtIndex:]:无法识别的选择器发送到实例0x4e1d6d0 ASIHTTPRequest
for(int i = 0;i<13;i++){
[request setPostValue:[propertyValues objectAtIndex:i] forKey:[propertyKeys objectAtIndex:i]];
}
我收到以下错误,但是:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL objectAtIndex:]: unrecognized selector sent to instance 0x4e1d6d0'
我试图来查找AHIHTTPRequest的文件,但该网站似乎是下降。
所以,而不是通过像NSArray propertyValues = [NSArray withObjects ...]来定义它们,我应该初始化它,还是我只需要在赋值变量后立即调用retain? – Chris 2011-06-03 23:20:58
废话不要说,你是对的。最初我将它们组合成一个NSDictionary,然后释放数组。接得好! – Chris 2011-06-03 23:21:52