i have NSMutableArray contains NSArray Objects, it looks like this
(
"2012-10-10 13:13:29 +0000",
cc5772389efc1f93bedaab872bad542a1c8432af,
"{\n size = {360, 480}\n CGImage.size = {480, 360}\n imageOrientation = UIImageOrientationRight\n}"
),
(
"2012-10-10 13:13:37 +0000",
6c09d99f940af8e7d1d1392d28abee2133b7ac75,
"{\n size = {360, 480}\n CGImage.size = {480, 360}\n imageOrientation = UIImageOrientationRight\n}"
),
(
"2012-10-10 13:13:19 +0000",
0165776bd9e96e640c905471ddb8630c22a8911c,
"{\n size = {360, 480}\n CGImage.size = {480, 360}\n imageOrientation = UIImageOrientationRight\n}"
)
each NSArray object contains NSDate object at the first index, i want to sort thisNSMutableArray from the older to the newest.
any idea?
You can use NSMutableArray’s
-sortUsingComparator:.to reverse the order, you can simply return
[date2 compare:date1]