On 27/04/2011, at 11:59 PM, Martin Batholdy wrote:
> [bookmarks sortUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]];
>
>
> but how can I first "group" the dictionaries by type and then within the
> types sort them by date?
> (so use two sorting-criteria with a different priority)
Either of these would allow you to do what you want for NSArray:
- (NSArray *)sortedArrayUsingComparator:(NSComparator)cmptr;
- (NSArray *)sortedArrayUsingFunction:(NSInteger (*)(id, id, void *))comparator
context:(void *)context;
And these for NSMutableArray:
- (void)sortUsingComparator:(NSCom
In that array of sort descriptors, you'd need to pass two of them. The first to
sort by type and the second to sort by date. The second sort descriptor would
only be used if two objects are sorted as equal by the first descriptor.
Dave
Sent from my iPhone
On Apr 27, 2011, at 6:59 AM, Martin B