Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Sorting an Array ios

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 185
    Comment on it

    Hello Readers,

    To sort an array in ios you may use the following code snippet:

    // Name of the key on basis of which you want to sort

     NSSortDescriptor *dateDescriptor = [NSSortDescriptor
                                                sortDescriptorWithKey:@"Key"   
                                                ascending:YES];   //Order of sorting
      NSArray *sortDescriptors = [NSArray arrayWithObject:dateDescriptor];
      NSArray *sortedArray = [[Array    // Name of array to be sorted
                             sortedArrayUsingDescriptors:sortDescriptors];

     

     

     

     

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: