title: iOS NSNumber intValue EXC_BAD_ACCESS
body: <pre><code>- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
  
    int num = 5;
        [viewController functionA:[NSNumber numberWithInt:num-1]];
  
  }
  
  -(void) functionA: (NSNumber*) indexNumber{
  
      int hi = [indexNumber intValue];
  
  }
  </code></pre>
  
  <p>viewController is an instance of a custom UIViewController class. functionA is a function in that class. touchesEnded is in another class.</p>
  
  <p>I get EXC_BAD_ACCESS. After searching online it seems it might be a release/alloc error, but I couldn't figure it out.</p>