views:

245

answers:

2

Hi Guys,

I need to display the list of names which are getting from the parser. I am getting the nsmutable arrary of list, then i need to display them in alphabetical order please provide solution.

Thank you, Madan Mohan.

I tried which you have given NSArray *myArtistArray=[[NSArray alloc]init]; myArtistArray=[artistsList sortUsingSelector:@selector(compare:) ];

// error void value not ignored as it outght to be [myArtistArray sortedArrayUsingSelector:@selector(compare:)];

+2  A: 
[yourMutableArray sortUsingSelector:@selector(compare:)];
[yourArray sortedArrayUsingSelector:@selector(compare:)];
drawnonward
i got error as error void value not ignored as it outght to be how can i get sorted that list
Madan Mohan
`sortUsingSelector` sorts a mutable array in place and does not return a value. `sortedArrayUsingSelector` creates and returns a sorted copy of the array.
drawnonward
A: 

`[yourMutableArray sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];1

jrtc27