sorting in core data
I use the following code to get list of nstri开发者_Python百科ngs
I want to sort them out alphabetically
how to do thar please
self.context = appDelegate.managedObjectContext;
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription
entityForName:@"Studies" inManagedObjectContext:_context];
[fetchRequest setEntity:entity];
NSError *error;
self.StudiessList = [_context executeFetchRequest:fetchRequest error:&error];
Add a sort descriptor to your fetch request. See NSSortDescriptor.
精彩评论