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

store cgpoint in userdefaults iOS swift