how to change order of NSMutable array in same way another mutable arrays get changed

后端 未结 5 820
遥遥无期
遥遥无期 2021-01-17 05:23

I have three arrays. They are name, birthdates and remaining days like below:

    name                         birth         


        
5条回答
  •  心在旅途
    2021-01-17 06:21

    Put each row into a dictionary, and out those dictionaries into an array. Then sort your away using a predicate or sort block. If you want an array containing just the sorted names for example, you could use [ array valueForKeyPath:@"name" ]

    Array looks like:

    [
        { @"name" : ..., 
            @"birthdate" : ...birthdate..., 
            @"remaining" : ...days remaining... } ,
        {...},
        {...}
    ]
    

提交回复
热议问题