作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Array
DAATA (
(
{
Description = "<p>Image3</p>";
"Image_Id" = 68;
"Image_Path" = "aa6b74d47227ebd24561211a2c95199c.jpg";
"Product_Address" = "Jaipur ,Rajastha";
"Product_Booked" = N;
"Product_Id" = 1;
"Product_Info" = "The Indian Hotels Company Limited (IHCL) and its subsidiaries are collectively known as Taj Hotels Resorts and Palaces and is recognised as one of Asia's largest and finest hotel company. Incorporated by the founder of the Tata Group, Mr. Jamsetji N. Tata, the company opened its first property, The Taj Mahal Palace Hotel, Bombay in 1903. The Taj, a symbol of Indian hospitality, completed its centenary year in 2003. ";
"Product_Latitude" = "26.9260\U00b0N";
"Product_Longitute" = "75.8235\U00b0E";
"Product_Name" = demo1;
"Product_Offer_Price" = "$200";
"Product_Price" = "$345";
"Product_Type" = "five star";
},
{
Description = "<p>yo yo</p>";
"Image_Id" = 75;
"Image_Path" = "415e2e6b7a3b1850e06467ade2e10fa9.jpg";
"Product_Address" = "jaipur,rajasthan";
"Product_Booked" = N;
"Product_Id" = 2;
"Product_Info" = "five star";
"Product_Latitude" = "";
"Product_Longitute" = "";
"Product_Name" = "hotel night rider";
"Product_Offer_Price" = "$200";
"Product_Price" = "$345";
"Product_Type" = "five star";
}
)
)
最佳答案
NSString *responseString = [request1 responseString];//your json response will be here
NSMutableDictinoary *dataDict = [[[responseString JSONValue] valueForKey:@"DAATA"]mutableCopy];//take response in dictinoary
for(int i = 0 ; i<[[dataDict valueForKey:@"DAATA"] count];i++)
{
if([[[[dataDict valueForKey:@"DAATA"] objectAtIndex:i] valueForKey:@"Image_Id"] isEqualToString:@"court"])//get what you want here for example get "Image_Id"
{
NSMutableDictionary *dd=[[dataDict valueForKey:@"result"] objectAtIndex:i];
[arrCourt addObject:dd];
}
and so on.........
}
关于objective-c - iPhone中如何从JSON格式的数组中一一提取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13817624/
这个问题在这里已经有了答案: final keyword in method parameters [duplicate] (9 个回答) 关闭 8 年前。 在此示例中,声明 Object fina
我的目标:是通过我的函数更新字段获取选定值并使用函数输出值运行它。 问题:当我从列表中选择值时,它不会触发函数,也不会更新字段。 感谢您的帮助。 HTML 12 14 16 18 20 22 24
我有一本具有这种形式的字典: myDict = {'foo': bar, 'foobar baz': qux} 现在,我想拆分字典键中的空格,使其成为下一个键并获取值(重复)。 myDictRev1
vector a; vector b; int temp_holder; cout > temp_holder) a.push_back(temp_holder); cout > temp_h
Java 的开发过程中免不了与 Date 类型纠缠,准备总结一下项目经常使用的日期相关操作,JDK 版本 1.7,如果能够帮助大家节约那么几分钟起身活动一下,去泡杯咖啡,便是极好的,嘿嘿。当然,我
我正在使用 jquery ui 日期选择器来获取 fromDate 和 toDate 以下是from日期的代码 $("#from_date").datepicker({
我是一名优秀的程序员,十分优秀!