I have an object with different values that is name,nameid, lifebeging,lifeEndiging …. etc,
for loop
{
// here i will get name, ids, other value for each object
Search *Obj=[artistslist objectAtIndex:i];
}
0 obj.name= //string values1 get from parser 1 obj.name= //string values1 2 obj.name= //string values1 3 obj.name= //string values1 4 obj.name= //string values1
I am getting values in the artistList then i need to sort only by name not other feilds
when i use this below statement
[artistsList sortUsingSelector:@selector(NSOrderedAscending:)];
i am getting exception here ,it is not working.
NSOrderedAscendingis not a selector, it’s an enumeration constant and is one of the three possible return values the selector you do specify should return. For NSStrings,caseInsensitiveCompare:is a good one, or as jrtc27 suggestslocalizedCaseInsensitiveCompare:if you are sorting to present to the user. If not a string, you can define your own method that compares two objects and returnsNSOrderedAscending,NSOrderedDescendingorNSOrderedSame.