Sort an NSMutablearray with custom objects in iOS

Solution:

You can use sortdescriptor to sort an array of objects.

NSSortDescriptor *sortDesc;
sortDesc = [[NSSortDescriptor alloc] initWithKey:@"createdDate"
                                           ascending:YES];
NSArray *sortArr = [arrayDetails sortedArrayUsingDescriptors:@[sortDesc]];


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift