title: Pick closest NSNumber from array
body: <p>I have an array with a bunch of <code>NSNumber</code>s. From an <code>UISlider</code> I get a certain value when the user stops dragging it. I would like to get the closes number from the array.</p>
  
  <p>So for instance, if the user drags the <code>UISlider</code> to <code>13</code>, and the <code>NSArray</code> contains the <code>NSNumbers</code> with <code>10</code> and <code>15</code>; I want to get <code>15</code> from the array.</p>
  
  <p>Example of array:</p>
  
  <pre><code>NSArray *values = [NSArray arrayWithObjects:[NSNumber numberWithInt:15],
                      [NSNumber numberWithInt:20],
                      [NSNumber numberWithInt:30],
                      [NSNumber numberWithInt:45],
                      [NSNumber numberWithInt:60],
                      [NSNumber numberWithInt:90],
                      [NSNumber numberWithInt:110], nil];
  </code></pre>
  
  <p>How do I get the correct number from the array?</p>