I have an app with a UITabBarController that manages some UINavigationControllers, which in turn manage various UIViewControllers.
On 3G phones, the first time I view any particular view via a TabBar button, it's laggy, but thereafter, it's snappy. This isn't noticeable with 3GS phones. My question is how can I force these views to pre-render? I have tried triggering the loadView functions by calling them in a different thread on start-up, but this doesn't do anything I don't think.
For clarity, here is an abbreviated snippet from my code to show what I'm doing. I have five view controllers, but I'm showing just the code for two. The poiVC is just a standard UITableViewController subclass - I don't even have a custom init or loadView function for it.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
self.mapVC = [[MapViewController alloc] init];
NavControlBar * mapNavBar = [[[NavControlBar alloc] initWithViewController:mapVC
withControlBar:[mapVC initBar]]autorelease];
self.poiVC = [[POIViewController alloc] init];
NavControlBar * poiNavBar = [[[NavControlBar alloc] initWithViewController:poiVC
withControlBar:[poiVC initBar]]autorelease];
NSArray *tabViewControllerArray = [NSArray arrayWithObjects:mapNavBar, poiNavBar, nil];
self.tbc.viewControllers = tabViewControllerArray;
self.tbc.delegate = self;
[mapVC release];
[poiVC release];
[window addSubview:tbc.view];
}
Can I get the poiVC to render while the user is looking at the first screen, so the transition will be fast?