开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜