0

starting a new project and want to try using the storyboard feature of xcode 4.2. i got the basics of how to do transitions within the story board, but how do i do it in the code (load a new view w/out the use of a button)?

do i just use the old method,

mapViewController *mapView = [[mapViewController alloc] initWithNibName:@"mapViewController" bundle:[NSBundle mainBundle]]; 
[self presentModalViewController:mapView animated:YES]; 

?

EDIT:

the old way doesn't work. also tried:

MapViewController *mapView = [self.storyboard instantiateViewControllerWithIdentifier:@"MapView"];
self presentModalViewController:mapView animated:YES];

with no success.

Padin215
  • 7,444
  • 13
  • 65
  • 103

2 Answers2

1

If you want to load a view controller you made in a storyboard create a segue to this view controller, give it an identifier and call: performSegueWithIdentifier:sender:.

dasdom
  • 13,975
  • 2
  • 47
  • 58
0

ok, i figured out the issue. i had uncommented the method "loadView" in the mapViewController so xcode did not use my storyboard layout.

also, both above methods do work to do a modal switch.

Padin215
  • 7,444
  • 13
  • 65
  • 103