title: Sort a NSMutableArray in objective-c?
body: <p>I am working on NSMutable Array containing list of "First Name" in it.I want to sort it alphabatically.</p>
  
  <p>I tried this code</p>
  
  <pre><code>NSSortDescriptor * sortFriend = [[[NSSortDescriptor alloc] initWithKey:kfirstName ascending:YES] autorelease];
  NSArray * descriptors = [NSArray arrayWithObject:sortFriend];
  NSArray * sorted = [Friendsarr sortedArrayUsingDescriptors:descriptors];
  </code></pre>
  
  <p>correct me if i am wrong.I do have an array of names also if that could be used.</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p>I tried the code</p>
  
  <pre><code>NSSortDescriptor * sortFriend = [[[NSSortDescriptor alloc] initWithKey:kfirstName ascending:YES  selector: @selector(caseInsensitiveCompare:)] autorelease];
  NSArray * descriptors = [NSArray arrayWithObject:sortFriend];
  NSArray * arrmp = [temparray sortedArrayUsingDescriptors:descriptors];
  </code></pre>
  
  <p>But still my result contain 2 'k' chars. one 'k' and 'K'.I want to have case insensitive result</p>