我在NSMutableArray
,它包含20 NSArray
。现在我想根据特定索引
NSMutableArray
进行排序
**Object 1**:(
Al Fresco - The Fruit Bar,
8 Patidar Society, Off. CG Road, Near TGB, Panchvati Cross Roads, Gulbai Tekra Rd, Panchavati Society, Gulbai Tekra, Amdavad,
CoQBegAAANnX8MekXEZA2KLckWQuZMaYQb01Q79iArH6Gf0jBHz_gmSimr4Zm-0Ns6WEmdkPwZJ_MBfOK-_r2T_P3myvH9itEss4FzUh6r0tH4h8zrw-jY9lgOSSuPKMd-EXiyuWjFlDnKG-VOS3fcy7AAvaIgujjiK23vYYWYn3R49gRw4mEhDdP7sGYp0fG0YuOzS-isx4GhTVU4rSVOta7GsZHvXxx4SuqFbWrA,
1.51,
23.023183,
72.555706
)
,
**Object 2**:(
Sarav Restaurant,
Jamnadas Chamber, Lal Darwaja, Lal Darwaja, Amdavad,
CoQBcgAAAE8z6_8pdBVzumQdsE8KskobotgcONp74KvE5cmygdMdFPv_S6doGmnrPM2six-KMBGPcKV24f4gKnTcj1ftfTYfEP0SrUZN6BCN6EVNBhZzeXUkdkjr3s6D3Rl0hAY3k2XdJdtNtTQ_tMlHvl0nS27fGb1yGVhn7VHCENsHaNS8EhAbD5pHmXCqfLD2dX8fi8uGGhRkOxv0xjIB5xDDBFp79gaD7SiElw,
0.94,
23.025021,
72.577415
)
答案 0 :(得分:2)
您可以使用sortUsingComparator:
[myMutableArray sortUsingComparator:^(id first, id second){
id obj1 = [first objectAtIndex:yourIndex];
id obj2 = [second objectAtIndex:yourIndex];
return [obj1 compare:obj2];
}]
中的更多信息