У меня есть контроллер массива с ключами nextCheck (NSDate), lastName (NSString) и firstName (NSString). Я установил дескрипторы сортировки для массива. Как вы можете видеть ниже, я сортирую сначала по nextCheck, затем по lastName, затем по firstName. Этот кажется не работает, потому что NSDate состоит не только из компонента даты, но и из компонента времени. Есть ли простой способ сортировки только по компоненту даты?
[_arrayCurrentVisits setSortDescriptors:[NSArray arrayWithObjects:[NSSortDescriptor sortDescriptorWithKey:@"nextVisit" ascending:YES selector:@selector(compare:)],[NSSortDescriptor sortDescriptorWithKey:@"lastName" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)], [NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)], nil]];