为了账号安全,请及时绑定邮箱和手机立即绑定

iPhone/IOS JSON解析教程

iPhone/IOS JSON解析教程

PIPIONE 2019-06-25 13:38:19
iPhone/IOS JSON解析教程作为一种学习体验,我希望创建一个iPhone应用程序,该应用程序调用一个webserver/webservice,检索一个JSON响应,并使用该响应填充UITableView(假设它将JSON转换为NSArray(第一)。有人知道什么可能有用吗?
查看完整描述

3 回答

?
慕沐林林

TA贡献2016条经验 获得超9个赞

你会喜欢这个的框架.

你会喜欢这个的工具.

为了了解JSON,您可能会喜欢以下内容资源.

你可能会喜欢这个补习.


查看完整回答
反对 回复 2019-06-25
?
守着一只汪

TA贡献1872条经验 获得超3个赞

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:@""]];
    }


查看完整回答
反对 回复 2019-06-25
  • 3 回答
  • 0 关注
  • 521 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信