Вопрос

I need to sort the rows in my sections, from fetchedResultsController.

I'm trying to make sure the Entity with lastCell attribute set to YES, to be the last shown cell in it's section. Somehow it's always the first? Is this not possible?

Ordering from timeStamp is working great. lastCell on the other hand doesn't seem to have any effect.

NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc] initWithKey:@"timeStamp" ascending:NO];
NSSortDescriptor *sortDescriptor2 = [[NSSortDescriptor alloc] initWithKey:@"lastCell"  ascending:NO];
Это было полезно?

Решение

Set the NSSortDescriptor fr the lastCell to be ascending. After all, False (aka 0) comes before True (1).

Другие советы

What you might try is creating a simple custom comparison method to use. This question would be a good reference for that:

Very custom order using NSSortDescriptor

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top