How to sort NSMutable array in ascending order. Can any one help me out this.
You haven't said what's in your array, but if it's something that responds to -compare:
then you can use
[myArray sortUsingSelector:@selector(compare):];
Here is a way to sort an array of object
NSSortDescriptor * descFirstname = [[NSSortDescriptor alloc] initWithKey:@"firstname" ascending:YES];
NSSortDescriptor * descLastname = [[NSSortDescriptor alloc] initWithKey:@"lastname" ascending:YES];
[myArrayOfPerson sortUsingDescriptors:[NSArray arrayWithObjects:descLastname,descFirstname, nil]];
[descFirstname release];
[descLastname release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With