Search code examples
iphonexcodeuitabbarcontroller

NSInvalidArgumentException Error When Using UITabBarController


I got the following error and I can't seem to figure out what happened. Please help me.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x57405a0'


Solution

  • If you're using:

     - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [array count]; } –
    

    Try:

    NSLog(@"%i", [array count]);
    

    And see what returns. Maybe the array is not been properly allocated.