I’m trying to make an “instructions” window with an UIScrollView with pageControl that contains some UIViewControllers:
- (void)loadScrollViewWithPage:(NSInteger)page {
if (page < 0 || page >= kNumberOfPages) return;
switch (page) {
case 0:
[[WelcomeViewController alloc] initWithNibName:@"WelcomeViewController" bundle:nil];
break;
case 1:
[[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
break;
case 2:
[[FirstTabViewController alloc] initWithNibName:@"FirstTabViewController" bundle:nil];
break;
case 3:
[[SecondTabViewController alloc] initWithNibName:@"SecondTabViewController" bundle:nil];
break;
case 4:
[[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];
break;
default:
[[WelcomeViewController alloc] initWithNibName:@"WelcomeViewController" bundle:nil];
break;
}
}
I can’t get it working.
The scroll works, but i can’t display any UIViewController i made!
How can i make it working?
Sounds like you’re more interested in a quick fix versus doing it right. Okay. Here’s how you’ll do it.