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?

iOS flutter while run to iPhone it had the error - Cannot find type 'PhoneNumberKit' in scope