【发布时间】:2013-12-12 12:20:36
【问题描述】:
我想按时间对数组进行排序。但问题是时间在另一个数组(数组的子数组)中的 UNIX 时间戳中。
这里是格式。请任何人帮我整理一下。
(
group,
"The Comic Corner",
""
),
(
group,
"Home Alone",
""
),
(
group,
"Romantic Movies",
""
),
(
group,
"Thriller Movies",
""
),
(
group,
Badminton,
""
),
(
group,
"Celebrity Gossip",
""
),
(
group,
"Dark Night",
""
),
(
group,
"Graphics Designer",
""
),
(
group,
"I Just Wanna....",
""
),
(
group,
Religion,
""
),
(
group,
"English Movies",
""
),
(
group,
"Music World",
""
),
(
group,
"Actions Movies",
""
),
(
group,
"Bed & Breakfast",
""
),
(
group,
"Strategic Games",
""
),
(
group,
"Beer Lovers",
""
),
(
group,
Hackers,
""
),
(
group,
"Darkroom-Darkroom",
""
),
(
group,
"Arcade Games",
""
),
(
group,
"Hindi Movies",
""
),
(
mood,
Anxious,
1386749684146
),
(
"profilepic_time",
1386545975408
),
(
"status_msg",
" *z32_ hell0",
1386635654457
),
(
Broadcast,
3,
11,
1372945566365
),
(
Broadcast,
3,
11,
3
),
(
Broadcast,
3,
11,
3
),
(
Broadcast,
3,
11,
1372858799160
),
(
Broadcast,
6,
11,
1372920363550
),
(
Broadcast,
6,
30,
1373012360303
),
(
Broadcast,
6,
30,
1373015204935
),
(
Broadcast,
6,
30,
1373018547181
),
(
Broadcast,
6,
30,
1373018768064
),
(
Broadcast,
7,
37,
1373025360112
),
(
Broadcast,
3,
37,
1373031270639
),
(
Broadcast,
3,
42,
1373868972980
),
(
Broadcast,
3,
29,
1372936645430
),
(
Broadcast,
3,
29,
1372935983470
),
(
Broadcast,
3,
101,
1374150527293
),
(
bulletin,
"dbxjsbxdijxjdjxichdjdixhdbdjx hdjdbdh",
1382331040766
),
(
bulletin,
"aaabbb ccc dddd eee ffff",
1382510132316
),
(
bulletin,
"dvxishhxxbbosihdjxibididhxososjshsisos dijfjeosksn osjdjkd",
1382510521856
),
(
bulletin,
tsotdo,
1382707279159
),
(
bulletin,
84saurzuzri,
1382707293764
),
(
bulletin,
aiaktsktzyodld,
1382707305875
),
(
bulletin,
uarsistoso,
1382707326326
),
(
bulletin,
2e58e8etisististi,
1382707335278
),
(
bulletin,
ztkzktzgtkktotk,
1382707484453
),
(
bulletin,
ztkzktzgtkktotk9e85a4a47a48a37ariz,
1382707491619
),
(
bulletin,
"dbxidj didcxj",
1384173984019
),
(
bulletin,
"testing testing testing testing",
1384589761276
),
(
bulletin,
"testing testing testing testing",
1384589772960
),
(
bulletin,
"testing testing testing testing",
1384589788706
),
(
bulletin,
"testing testing testing testing",
1384589822861
),
(
bulletin,
"testing testing testing testing",
1384589871332
),
(
bulletin,
"testing testing testing testing",
1384589875364
),
(
bulletin,
"testing testing testing testing",
1384589910927
),
(
bulletin,
hey,
1384589984774
),
(
bulletin,
"heya ",
1384590016235
),
(
bulletin,
ok,
1384597237610
),
(
bulletin,
"hey ",
1384605812061
),
(
bulletin,
fhjfs,
1384757502287
),
有些数组有时间戳,有些数组没有时间戳
这对我来说非常复杂。任何人都可以帮助我吗 谢谢
【问题讨论】:
-
查看 NSArray 的任何“sortedArrayUsing...”方法,以及 NSMutableArray 的“sortUsing...: 方法”。我通常发现对于我的片状大脑来说使用“.. .UsingFunction" 风格并为比较器定义 C 风格的函数,但其他人喜欢花哨的块的东西。
-
它不是从 nsmutable 数组中给出的排序方法中排序的。我认为我们必须手动对其进行排序。但我找不到工作它的确切逻辑
标签: ios iphone sorting nsarray