title: iOS how does NSMutableArray check if it contains NSNumber objects?
body: <p>I'm writing some code that will be using NSMutableArray and storing int values within it, wrapped within NSNumbers. </p>
  
  <p><strong>I would like to confirm that querying an iOS NSArray or NSMutableArray using new NSNumbers with same values is legal</strong>, of if I need to explicitly iterate over the array, and check if each int value is equal to the value I want to test against?</p>
  
  <p>This appears to work:</p>
  
  <pre><code>NSMutableArray* walkableTiles = [NSMutableArray array];    
  
  
  [walkableTiles addObject:@(1)];
  [walkableTiles addObject:@(2)];
  [walkableTiles addObject:@(3)];
  
  
  if([walkableTiles containsObject:@(1)])
  {
      DLog(@"contains 1"); //test passes
  }
  if([walkableTiles containsObject:[NSNumber numberWithFloat:2.0]])
  {
      DLog(@"contains 2");//test passes
  }
  if([walkableTiles containsObject:[NSNumber numberWithInt:3]])
  {
      DLog(@"contains 3");//test passes
  }
  </code></pre>