我正在使用 ASIHTTPRequest 从服务器获取 JSON 响应。我想将此响应转换为 NSArray。我的代码:
NSURL *url = [NSURL URLWithString:@"http://chirkov.net.ua/iosnettest/request.php?act=showdata&query=2;0;3;0;ASC"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
NSError *error = [request error];
if (!error) {
NSData *responseData = [[NSMutableData alloc] initWithData:[request responseData]];
NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:responseData];
NSLog(@"array = %@",array);
}
但有异常Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0xffffffef, 0xffffffbb, 0xffffffbf, 0x5b, 0x7b, 0x22, 0x69, 0x64
。我该如何解决我的问题?