title: Why does this code break at removeObject:?
body: <pre><code>+ (NSString *)numberMatching: (NSString *)number and: (NSString *)secondNumber
  {
     NSString *returnNumber;
     if ([number isEqualToString:secondNumber]) {
        returnNumber = number;
     } else {
        NSMutableArray *validNumber = [[self validNumbers] copy];
        [validNumber removeObject:number];
        [validNumber removeObject:secondNumber];
        returnNumber = validNumber[0];
     }
     return returnNumber;
  }
  </code></pre>
  
  <p>In case it matters, here is the code for validNumber:</p>
  
  <pre><code>+ (NSArray *)validNumbers
  {
     static NSArray *validNumbers = nil;
     if (!validNumbers) validNumbers = @[@"one",@"two",@"three"];
     return validNumbers;
  }
  </code></pre>
  
  <p>When run, I get the following error:</p>
  
  <blockquote>
    <p>-[_<em>NSArrayI removeObject:]: unrecognized selector sent to instance 0x1ed60f00 ... Terminating app due to uncaught exception
    'NSInvalidArgumentException', reason: '-[</em>_NSArrayI removeObject:]:
    unrecognized selector sent to instance 0x1ed60f00'</p>
  </blockquote>
  
  <p>That would seem to indicate that removeObject is not a valid method for an NSMutableArray, but it is valid.</p>
  
  <p>Essentially, what I want to do is this: if the two arguments match, I want to return the value. If they don't match, I want to return the third possibility (doesn't match either argument).</p>