Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jch02140

macrumors newbie
Original poster
Feb 27, 2013
4
3
I download the sample Web App template from the following page:

http://www.bitwit.ca/blog/an-native-ios-web-app-tutorialtemplate/

I ran the xcode project and it shows the local HTML page just fine. I proceed to modify the code a bit to add tab menu. However, when I recompile the xcode project again the emulator screen is entirely white. I need to press the home button on the emulator, double press it to bring up the multitasking bar and then return to the program again in order to have the screen update to show the local HTML file with the tab menu.

Is there something I missed? How do I fix the initial white screen launch bug?

Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    UITabBarController *tabController = [[UITabBarController alloc] init];
    
    WebViewController *viewController1 = [[WebViewController alloc] init];
    
    UIViewController *viewController2 = [[UIViewController alloc] init];
    
    UIViewController *viewController3 = [[UIViewController alloc] init];
    
    UIViewController *viewController4 = [[UIViewController alloc] init];
    
    tabController.viewControllers = [NSArray arrayWithObjects:viewController1,
                                     viewController2,
                                     viewController3,
                                     viewController4, nil];
    
    self.window.rootViewController = tabController;
    
    // self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.