0

I'm building an application which has a TabBarController at the top level. Contained within one of the tabs there is a tableview, and when a row is selected, I'd like to go to a set of 5 views, controlled via a UIScrollViewDelegate and UIPageControl.

I've built a basic app with the UIScrollViewDelegate and UIPageControl, based Derek Bredensteiner's code in this answer: How do I use UIPageControl to create multiple views?

It works fine as a stand alone application, ie: when the ViewController code is called directly from the AppDelegate via:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

But when I try to call the same code from my tableview code, I am getting a black screen. I've also tried using presentModelViewController and I get the UIPageViewControl dots but the rest is black.

LearnPageViewController *phoneContentController = [[LearnPageViewController alloc] init] ;
//  [self presentModalViewController:phoneContentController animated:YES];
[self.navigationController pushViewController:phoneContentController animated:YES];
Community
  • 1
  • 1
port5432
  • 5,889
  • 10
  • 60
  • 97
  • I managed to get it to work by adding a new window property @property (nonatomic, retain) IBOutlet UIWindow *window; but it doesn't sound right. There is a window property up on the AppDelegate and now another one 2 levels down. – port5432 Oct 08 '12 at 14:40

1 Answers1

0

I managed to get it to work by adding a new window property @property (nonatomic, retain) IBOutlet UIWindow *window; but it doesn't sound right. There is a window property up on the AppDelegate and now another one 2 levels down.

port5432
  • 5,889
  • 10
  • 60
  • 97