How do I make this piece of code to order in descending order. This code always gives me the array in ascending order:
NSArray *sortedProductsByStyle = [unsortedProducts sortedArrayUsingComparator: ^(Product *p1, Product *p2) { return [p1.productStyle compare:p2.productStyle options:NSNumericSearch]; }];
I thought that using NSOrderedDescending would work but it didn't:
NSArray *sortedProductsByStyle = [unsortedProducts sortedArrayUsingComparator: ^(Product *p1, Product *p2) { return [p1.productStyle compare:p2.productStyle options:NSNumericSearch | NSOrderedDescending]; }];
Any ideas?