gpt4 book ai didi

ios - 如何从字符串中的json获取数组响应?

转载 作者:行者123 更新时间:2023-12-01 17:50:38 25 4
gpt4 key购买 nike

我正在从json这样得到响应

 parcel =     (
{
datetime = "2015-08-31 21:48:45";
height = 2;
id = 21;
invoice = NO;
length = 2;
mtype = IN;
"num_item" = 2;
"parcel_number" = 1;
pname = "Parcel number - 1";
"pro_number" = tanu;
status = 1;
type = Exact;
uid = 185;
weight = 2;
width = 2;
wtype = KG;
}
);

我想在一个字符串中获取高度,日期时间,发票。如何做到这一点?任何人都可以帮助我...

最佳答案

NSArray * arr_Parcel = [[NSArray alloc]initWithArray:data];
NSMutableDictionary * temp_Dict = [[NSMutableDictionary alloc]init];
for (int i = 0 ; i < arr_Parcel.count; i++)
{
temp_Dict = [arr_Parcel objectAtIndex:i];
NSString * strHeight = [temp_Dict objectForKey:"height"];
NSString * strdate = [temp_Dict objectForKey:"datetime"];


}

关于ios - 如何从字符串中的json获取数组响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32326946/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com