-1

How do you switch between view controllers programatically in an effective manner? I am currently utilising:

ViewController *viewController = [[ViewController alloc] init];
    [self presentViewController:viewController animated:YES completion:nil];

However this does not display the items that I've inserted using the interface builder. Only the items I've inserted programatically.

I wish to do this, as I want to display a home button on each page.

B-B.
  • 193
  • 1
  • 3
  • 14

1 Answers1

6

Give your viewController identity in StoryBord

enter image description here

then into your code

UIViewController *documetController       = [storyboard instantiateViewControllerWithIdentifier:@"MXDocumentViewController"];
[self.navigationController pushViewController:reviewListController animated:YES];
Retro
  • 3,985
  • 2
  • 17
  • 41
  • I don't have a navigation controller. Is it required? – B-B. Aug 07 '14 at 10:10
  • 1
    NavigationController is a good way if your dealing with more then one viewController into application. but still you can use [self presentViewController:viewController animated:YES completion:nil]; – Retro Aug 07 '14 at 10:12