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]];
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
Post a Comment