Search code examples
iphoneiospushviewcontrollersigabrt

SIGABRT error when using pushViewController


I am not sure why I am getting a SIGABRT error when I go to do the pushViewController. I have mpCustomFoodController as a IBOUTLET and have a viewController inside of my nib file and a file that is waiting to receive this but then it fails on this call every time.

 -(IBAction)createNewCustomFood:(id)sender{
    [self cancelButtonColorChange:sender];
    self.title = @"Cancel";

   mpCustomFoodController = [[MPCustomFood alloc]initWithNibName:@"MPCustomFood" bundle:nil];
   //this is where the error occurs once is calls this
   [self.navigationController pushViewController:mpCustomFoodController animated:YES];
   //this will be calling the new view

}


Solution

  • If I had to guess, I'd say you either aren't using the correct nib name, or your File's Owner object has a non-existent outlet that's being assigned to. Also, if you've replaced the main view in the nib or changed the class of its controller, the view outlet may be unassigned.