开发者

sorting in core data

开发者 https://www.devze.com 2023-02-18 03:33 出处:网络
I use the following code to get list of nstri开发者_Python百科ngs I want to sort them out alphabetically

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消