Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何对NSMutableDictionary进行排序_Objective C_Ios_Nsmutabledictionary - Fatal编程技术网

Objective c 如何对NSMutableDictionary进行排序

Objective c 如何对NSMutableDictionary进行排序,objective-c,ios,nsmutabledictionary,Objective C,Ios,Nsmutabledictionary,我正在使用NSMutableDictionary保存数据并将其加载到UITableview, 这是字典的样子: 041517ba8e0542b14e96469d87bba694b42db15a = ( "{\n size = {360, 480}\n CGImage.size = {480, 360}\n imageOrientation = UIImageOrientationRight\n}", 041517b

我正在使用
NSMutableDictionary
保存数据并将其加载到
UITableview
, 这是字典的样子:

    041517ba8e0542b14e96469d87bba694b42db15a =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    041517ba8e0542b14e96469d87bba694b42db15a,
    "2012-10-10 10:17:13 +0000"
);
3582a7ee9ce2e232704c3e51f27bdc9274e965c6 =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    3582a7ee9ce2e232704c3e51f27bdc9274e965c6,
    "2012-10-10 10:12:57 +0000",
    "Plastic Cup"
);
3ce8b24a9da8916f2d669f625c9eb28e77b710ec =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    3ce8b24a9da8916f2d669f625c9eb28e77b710ec,
    "2012-10-10 10:12:48 +0000",
    Headphones
);
9a2fd3bbd741e52cfc31d2a341ab79241c3048db =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    9a2fd3bbd741e52cfc31d2a341ab79241c3048db,
    "2012-10-10 10:11:58 +0000",
    "Men's Wrist Watch"
);
b7b8646cb8548e6c8cc1c83b90b9d8d3b265ed5b =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    b7b8646cb8548e6c8cc1c83b90b9d8d3b265ed5b,
    "2012-10-10 10:14:46 +0000",
    Dog
);
c30fe8901a4e14da415981ade707330bda85c2bf =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    c30fe8901a4e14da415981ade707330bda85c2bf,
    "2012-10-10 10:14:32 +0000",
    "Dog Olive"
);
d47987a197cc9b383921ef021d5469cd69e02dec =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    d47987a197cc9b383921ef021d5469cd69e02dec,
    "2012-10-10 10:12:24 +0000",
    Blurry
);
d8363eb358ce8a6266d9dae37b19628d8be8e604 =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    d8363eb358ce8a6266d9dae37b19628d8be8e604,
    "2012-10-10 10:13:08 +0000",
    "Analog Wristwatch"
);
e849e2f6d45a787fff42486cd8cb4d45499b2ef4 =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    e849e2f6d45a787fff42486cd8cb4d45499b2ef4,
    "2012-10-10 10:15:14 +0000",
    "Red Sports Car"
);
f0c5598cd2a5314d64bd25dffbef2c98be78ac0f =     (
    "{\n    size             = {360, 480}\n    CGImage.size     = {480, 360}\n    imageOrientation = UIImageOrientationRight\n}",
    f0c5598cd2a5314d64bd25dffbef2c98be78ac0f,
    "2012-10-10 10:12:40 +0000",
    "Laptop Computer Keyboard"
);
它包含一张照片,但不是按顺序(添加到字典中)我想要的是按照片添加的顺序绘制
UITableView


有什么想法吗?

对键使用
NSMutableArray
并在每次向字典添加照片时向该
NSMutableArray
添加一个键。数组将保持顺序

对键使用
NSMutableArray
,并在每次向字典添加照片时向该
NSMutableArray
添加键。数组将保持顺序

字典是未排序的集合

您应该真正考虑将字典或键放入数组中


然后可以使用数组进行排序,并使用键引用字典。

字典是未排序的集合

您应该真正考虑将字典或键放入数组中

然后可以使用数组进行排序,并使用键引用字典