我正在通过网络服务列出一个项目的数量百分比,例如一个项目。我得到的响应是一个类似于下面代码的字典数组。我需要它以排序格式
NSArray *numberArray = [NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:-12.0], @"price", nil],
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:-86.0],@"price", nil],
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:-8.0],@"price", nil],
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:12.0],@"price", nil],
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:2.0],@"price", nil],
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:112.0],@"price", nil], nil];
这是 JSON 响应的日志
[
{
price = "-12";
},
{
price = "-86";
},
{
price = "-8";
},
{
price = 12;
},
{
price = 2;
},
{
price = 112;
}
]