当我正在解析'
的代码标题中出现a 时,我的应用程序崩溃了。JSON
此行正在加载标题的:
[[cell textLabel] setText:[item objectForKey:@"title"]];
JSON:
NSString *jsonString = [NSString
stringWithContentsOfURL:[NSURL URLWithString:@"**test.php"]
encoding:NSStringEncodingConversionAllowLossy
error:nil];
// Create parser
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *results = [parser objectWithString:jsonString error:nil];
parser = nil;
// Set tableData
[self setTableData:[results objectForKey:@"items"]];
碰撞:
tableData NSArray * 0x00000001
2012-04-10 10:29:11.446 * [21222:f803] -[NSNull isEqualToString:]:无法识别的选择器发送到实例 0x146ace8 2012-04-10 10:29:11.447 * [21222:f803] * 由于应用程序终止未捕获的异常'NSInvalidArgumentException',原因是: ' - [NSNull isEqualToString:]:无法识别的选择发送到实例0x146ace8' *第一掷调用堆栈:(0x13d4022 0x1565cd6 0x13d5cbd 0x133aed0 0x133acb2 0x15e0ff 0x2b10 0xb8c54 0xb93ce 0xa4cbd 0xb36f1 0x5cd21 0x13d5e42 0x1d8c679 0x1d96579 0x1d1b4f7 0x1d1d3f6 0x1db81ce 0x1db8003 0x13a8936 0x13a83d7 0x130b790 0x130ad84 0x130ac9b 0x12bd7d8 0x12bd88a 0x1e626 0x1ded 0x1d55)终止调用抛出异常(lldb)