I have NSSet
of NSString
s. I want to return alphabetically sorted array of NSSet
elements with method – sortedArrayUsingDescriptors:
.
I have read NSSortDescriptor
documentation and still have no clue how to create one for simple NSString
objects.
What key
should I specify? Is there a better approach than using NSSortDescriptor
?
I can't find it documented that passing nil
for the key is safe and means to use the object itself. So, I'd be hesitant to use it. You can use @"self"
instead.