title: Sort Descriptors not sorting numbers in the form of string - iphone
body: <p>I have some string saved in core data </p>
  
  <p>@"123", @"1" , @"432", @"90003", @"4567", @"1002"</p>
  
  <p>This needs to be sorted ascending and this is the code i have written</p>
  
  <pre><code>NSFetchRequest *request1 = [[NSFetchRequest alloc] init];
              [request1 setEntity:[NSEntityDescription entityForName:@"ABCD" inManagedObjectContext:context]];
              [request1 setIncludesPendingChanges:NO];
              sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"statusIdNo" ascending:YES selector:@selector(localizedStandardCompare:)];
              [request1 setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];
  
              statusArray = [context executeFetchRequest:request1 error:nil];
  </code></pre>
  
  <p>But this code is not sorting it the way required. Am i missing anything here?</p>
  
  <p><strong>EDIT:</strong>  </p>
  
  <pre><code>The Required Result : @"1" , @"123", @"432", , @"1002",  @"4567", @"90003"
  Whats coming now : @"123"@"432",@"1"  , @"1002",   @"90003", @"4567"
  </code></pre>
  
  <p>One more thing i would like to add is that, the array doesn’t contain the strings as it is. These are core data entity objects. Like example it contains students object say for class X which has all the students’ roll numbers, names and marks as their attributes. And we need to sort it based on roll numbers which is stored as an NSNumber. </p>