I want to sort my array alphabetically in objective-c. I have implemented it this way.
//Sorting of the Array
NSArray *sortedArray = [arrName sortedArrayUsingComparator:^(Cars *firstObject, Cars *secondObject) {
return [firstObject.str_name compare:secondObject.str_name];
}];
arrName =[NSMutableArray arrayWithArray:sortedArray];
The problem is all the numbers appear followed by captial letters words followed by lowercase letters items...
I want it to appear alphabetically-> meaning to say that the capital letters and lowercase letters maybe mixed.