3 つのオブジェクトを含む NSArray があります。各オブジェクトは 5 つの値で構成されます。オブジェクトで日付順に並べ替えるにはどうすればよいですか?
result: (
gg,
"2012-10-28 01:34:00 +0000",
"Church Bells",
"pin_red",
1
)(
iu,
"2008-09-22 17:32:00 +0000",
"Birthday Song",
"pin_red",
1
)(
"my birthday woo hoo",
"2012-09-04 19:27:00 +0000",
"Birthday Song",
"pin_blue",
1
)
私が探している結果 - ソートされた配列は次のようになります。
(
iu,
"2008-09-22 17:32:00 +0000",
"Birthday Song",
"pin_red",
1
)
(
"my birthday woo hoo",
"2012-09-04 19:27:00 +0000",
"Birthday Song",
"pin_blue",
1
)
(
gg,
"2012-10-28 01:34:00 +0000",
"Church Bells",
"pin_red",
1
)
nsdictionary オブジェクトからこの配列を取得しています。
dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:stringsPlistPath];
stringsMutableArray = [[NSMutableArray alloc] initWithObjects:nil];
for (id key in dictionary)
{
[stringsMutableArray addObject:[dictionary objectForKey:key]];
}