【发布时间】:2015-08-19 20:26:24
【问题描述】:
我有一个包含以下数据的 NSArray;
(
{
3d = 0;
cinemaId = 9;
displayDate = "2015-08-19";
end = "2015-08-20T00:14:00+02:00";
hallIsLarge = 0;
hfr = 0;
id = 1505511;
imax = 0;
movieId = 19623;
nl = 0;
ov = 1;
showId = 24422279;
specialCode = "<null>";
specialId = "<null>";
start = "2015-08-19T22:00:00+02:00";
status = 3;
vip = 0;
},
{
3d = 1;
cinemaId = 10;
displayDate = "2015-08-19";
end = "2015-08-20T00:25:00+02:00";
hallIsLarge = 0;
hfr = 0;
id = 1504415;
imax = 0;
movieId = 16936;
nl = 0;
ov = 1;
showId = 24436778;
specialCode = "<null>";
specialId = "<null>";
start = "2015-08-19T22:05:00+02:00";
status = 3;
vip = 0;
},
{
3d = 0;
cinemaId = 9;
displayDate = "2015-08-19";
end = "2015-08-20T00:08:00+02:00";
hallIsLarge = 0;
hfr = 0;
id = 1506419;
imax = 0;
movieId = 21068;
nl = 0;
ov = 1;
showId = 24422340;
specialCode = "<null>";
specialId = "<null>";
start = "2015-08-19T22:10:00+02:00";
status = 3;
vip = 0;
},
{
3d = 0;
cinemaId = 10;
displayDate = "2015-08-19";
end = "2015-08-20T00:08:00+02:00";
hallIsLarge = 0;
hfr = 0;
id = 1504237;
imax = 0;
movieId = 21068;
nl = 0;
ov = 1;
showId = 24436788;
specialCode = "<null>";
specialId = "<null>";
start = "2015-08-19T22:10:00+02:00";
status = 3;
vip = 0;
}
)
我想按“开始”键对字典进行排序。为此,我有:
NSSortDescriptor *brandDescriptor = [[NSSortDescriptor alloc] initWithKey:@"start" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObject:brandDescriptor];
programmering = [programmering sortedArrayUsingDescriptors:sortDescriptors];
在上面的代码中是“编程”数组,但它似乎不起作用。
我可以做些什么来完成这项工作? 提前感谢您的帮助。
【问题讨论】:
标签: ios objective-c nsarray