Hi,
I'm working on an iPhone and I'm using Core Data as my store.
What I'd like to do is list the top 50 entities in descending order by their height.
I'm struggling to find out the syntax for the predicate.
Hi,
I'm working on an iPhone and I'm using Core Data as my store.
What I'd like to do is list the top 50 entities in descending order by their height.
I'm struggling to find out the syntax for the predicate.
Hi
First, go to the NSFetchRequest class reference.
Use the sort descriptor to your fetch request :
NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)];
[request setSortDescriptors:[NSArray arrayWithObject:sort]];
And use the fetchLimit property
[request setFetchLimit:50];