iPhone/IOS JSON解析教程

iPhone/IOS JSON解析教程

作为一种学习体验,我希望创建一个iPhone应用程序,该应用程序调用一个webserver/webservice,检索一个JSON响应,并使用该响应填充UITableView(假设它将JSON转换为NSArray(第一)。

有人知道什么可能有用吗?


PIPIONE
浏览 513回答 3
3回答

慕沐林林

你会喜欢这个的框架.你会喜欢这个的工具.为了了解JSON,您可能会喜欢以下内容资源.你可能会喜欢这个补习.

守着一只汪

SBJSON *parser = [[SBJSON alloc] init];NSString *url_str=[NSString stringWithFormat:@"Example APi Here"]; url_str = [url_str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:url_str]]; NSData *response = [NSURLConnection sendSynchronousRequest:request  returningResponse:nil error:nil]; NSString *json_string = [[NSString alloc] initWithData:response1 encoding: NSUTF8StringEncoding]NSDictionary *statuses = [parser2 objectWithString:json_string error:nil];  NSArray *news_array=[[statuses3 objectForKey:@"sold_list"] valueForKey:@"list"];     for(NSDictionary *news in news_array){     @try {         [title_arr addObject:[news valueForKey:@"gtitle"]];    //values Add to title array     }     @catch (NSException *exception) {         [title_arr addObject:[NSString stringWithFormat:@""]];     }
打开App,查看更多内容
随时随地看视频慕课网APP