title: Sorting Number using NSSortDescriptor
body: <p>I got stuck in another problem again but after a long time.</p>
  
  <p>This time I have database (Core Data), having an attribute of <code>numbers</code> which contains integer numbers like 213879,123,4,345,56567 and so.</p>
  
  <p>I need to fetch data in ascending number order similar to like <code>alphabetically</code> order.</p>
  
  <p>I am doing this in way given below,</p>
  
  <pre><code>fetchRequest.sortDescriptors=[NSArray arrayWithObject:
        [NSSortDescriptor sortDescriptorWithKey:@"numbers" 
                                      ascending:YES 
                                       selector:@selector(compare:)]];
  </code></pre>
  
  <p>but unfortunately it compares only the 1st digit of every number, mean if there are 2 numbers like <code>123</code> and <code>321</code>, it will compare <code>1 (first digit of first number)</code> with <code>3 (first digit of second number)</code> and sort them.</p>
  
  <p>It got confuse when there comes <code>123</code> and <code>111</code> (same first digits of all numbers).</p>
  
  <p>If I am doing something wrong or the SortDescriptor works in this way?
  I need the solution to sort the numbers in ascending <code>123,133,213,451,516</code> likewise. </p>
  
  <p><strong>Thing to Remember</strong> 
  In actual the attribute <code>numbers</code> will contains integer numbers having digits more then 6. e.g <code>1234567,234568,235481</code></p>
  
  <p>Thanks to all who helps me a lot in anticipation.</p>