I have an NSArray
which contain objects. my Objects are like this :
@interface Personne : NSObject{
int _id;
NSString *name;
}
I have a Web services which returns to me persons by name. for example; when I click in the search bar and I put "a", the server returns to me all the persons where her name contains "a", I put the result in an NSArray
. Now I would like to sort my array and put the persons whose name begins with "a" in the beginning of my array and the others at the end. How can I do this?
Edit: For example I have the response of the server like this :
marakech
arabie
malakit
arsenal
astonvilla
I would like to sort like this :
arabie
arsenal
astonvilla
malakit