It should be simple:
NSArray *sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"age" ascending:YES] ]; NSArray *sortedPeople = [people sortedArrayUsingDescriptors:sortDescriptors]; NSLog(@"%@", sortedPeople);
This will work regardless of whether or not you use βUse scalar properties for primitive data typesβ when creating your NSManagedObject subclass (if you decide to even create them)
source share