Search code examples
iosibaction

My IBAction no work when i click


I create a button in my mainViewController. The button should go to the page ItaliaViewController but my button does not work.

Here is my code

   -(IBAction)openRubric:(id)sender
    {
      ItaliaViewController *italia = [self.storyboard  instantiateViewControllerWithIdentifier:@"rubric_italia"];
    }

please help me


Solution

  • You have to present your new view controller, in your case z ItaliaViewController. use this

          [self presentViewController:italia animated:YES completion:nil];