Pushed UIViewController appears on the screen but the buttons from the pushing view remains active

84 Views Asked by At

I have an IOS application which has several views. In one of them I have a button action that push another view that has several buttons that are not activated although the view appears in the screen. If I touch in an area that was part of the previous screen the control is passed to the previous view.

I have checked the view controller and the view has the correct Owner.

- (IBAction)touchupinsideMenu:(id)sender {
    self.navigationItem.title=@"Menu";
    self.SubmenuViewControllerVIP=[[ SubmenuViewController alloc] initWithNibName:@"SubmenuViewController" bundle:nil];
    [self.navigationController pushViewController:self.SubmenuViewControllerVIP animated:YES];

}

------------ EDITED -----------------------

The pushed view is not responding to the buttons and the pushing view's buttons are still active although the view is shown in the screen.

Any Idea? Thanks

1

There are 1 best solutions below

8
On

This is the correct way of initiating a UIViewController to push:

UIViewController *SubmenuViewControllerVIP = [self.storyboard instantiateViewControllerWithIdentifier:@"SubmenuViewController"];

You need to use storyboards, tho.