我在 SBJson *parser 下得到一条红线,现在我不知道如何删除此错误。我应该安装某种库,或者我应该怎么做才能消除这个错误?我被困在目标 C 中的 json 解析中。
SBJSON *parser=[[SBJsonParser alloc] init];
NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost/jsontest1.php"]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *json_string = [[NSString alloc] initWithData:response encoding: NSUTF8StringEncoding];
NSArray *statuses = [parser objectWithString:json_string error:nil];
for (NSDictionary *status in statuses)
{
NSLog(@"%@ - %@", [status objectForKey:@"text"],
[[status objectForKey:@"user"]objectForKey:@"screen_name"]);
}