I have an Array with some String objects lets say months.
[October] [May] [July] [January] [August]
and I want to sort it:
[January] [May] [July] [August] [October]
is there a smart way of doing this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no specific logic in the NSString by then selfs, to achieve the kind of sorting you want. You could have, instead of NSString, NSDictionaries. With keys according to the order you want, for example:
1 – January
5 – May
7 – July
You could then re-order using the key.