在 UITableViewCell 中显示 json 响应?
这是我来自 web 服务的 json 响应,
更改选项 = ( { 描述 = ( “一些文字” ); 发票=0; 建议零售价=0; OptionCode = "一些文本"; OptionGroup = "一些文本"; 选项部分 = 包; 状态=已选择; }, { 描述 = ( “一些文字” ); 发票=50; 建议零售价=50; OptionCode = "一些文本"; OptionGroup = "一些文本"; 选项部分 = 包; 状态=未选择; }, { 描述 = ( “一些文字” ); 发票=0; 建议零售价=0; 选项代码 = 28F; OptionGroup = "一些文本"; 选项部分 = 包; 状态 = 必填; }, { 描述 = ( “一些文字” ); 发票=0; 建议零售价=0; 选项代码 = 27F; OptionGroup = "CPOS PKG"; 选项部分=动力传动系; 状态 = 排除; },
}
也想使用 OptionSection ex 获取特定的数组索引
:在此响应中,我必须显示说明、发票、MSRP、OptionCode、OptionGroup,即,如果 OptionSection =“Packages”超过一个计数,则对应于“Packages”我必须在 UITableView 中显示所有这些内容,
请对此提出任何建议
This is my json response from webservice,
ChangedOptions = ( { Descriptions = ( "some text" ); Invoice = 0; MSRP = 0; OptionCode = "some text"; OptionGroup = "some text"; OptionSection = Packages; State = Selected; }, { Descriptions = ( "some text" ); Invoice = 50; MSRP = 50; OptionCode = "some text"; OptionGroup = "some text"; OptionSection = Packages; State = Unselected; }, { Descriptions = ( "some text" ); Invoice = 0; MSRP = 0; OptionCode = 28F; OptionGroup = "some text"; OptionSection = Packages; State = Required; }, { Descriptions = ( "some text" ); Invoice = 0; MSRP = 0; OptionCode = 27F; OptionGroup = "CPOS PKG"; OptionSection =PowerTrain; State = Excluded; },
}
i want too fetch the particular array index using the OptionSection
ex: in this response i have to display the Description,Invoice,MSRP,OptionCode,OptionGroup i.e, corresponding to the "Packages" if OptionSection = "Packages" is more than one count i have to display all those things in UITableView
please give any suggestion for that
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该首先了解如何在 iPhone 上使用 JSON 解析器。
这是一个很好的教程: http://mobileorchard.com/tutorial- json-over-http-on-the-iphone/
You should look in to how to use a JSON-parser on iPhone first.
This is a good tutorial: http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/