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

How to blink a button iOS swift?

Convert NsNumber, NSDate to String in iOS Swift

Parse the value from string value iOS swift