sortUsingDescriptors:
expects an NSArray
of sort descriptors as its first argument:
[_objects sortUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"rank" ascending:YES selector:@selector(compare:)]]];
Or a bit longer:
NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"rank" ascending:YES selector:@selector(compare:)];
[_objects sortUsingDescriptors:@[descriptor]];