Upgrade to iPhone 3.0 sdk and now simulator shows blank screen

前端 未结 8 1277
轻奢々
轻奢々 2021-01-13 08:47

I have an iPhone app that uses an UITabBarController, which contains two UINavigationControllers, each of which in turn contains one or more TableViewControllers (actually,

相关标签:
8条回答
  • 2021-01-13 09:01

    I had the same problem of getting white screen on iphone simulator after upgrading my iOS to 4.2

    After trying all the above solutions given by the people in this thread and nothing effecting the problem,

    I tried modifying the following code in the

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    

    method.... by writing this code...

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
    
    
    
        // HomeScreen is my first view that should be displayed on the app launch
        // Creating the homescreen instance in the appdelegate method and 
        // assigned it to the homeScreenWindow element declared in the appdelegate class
    
        HomeScreen *aHomeScreen = [[HomeScreen alloc]initWithNibName:@"HomeScreen" bundle:nil];
        self.homeScreenWindow = aHomeScreen;
        [aHomeScreen release];
        // assigning ends here
    
        [window addSubview:[homeScreenWindow view]];
        [window makeKeyAndVisible];
    
        return YES;
    }
    
    0 讨论(0)
  • 2021-01-13 09:06

    Yes, I finally found the simple fix - open Window in MainWindow.xib, change the Alpha value to 0 (default is 100).

    0 讨论(0)
  • 2021-01-13 09:09

    I fixed mine by changing the mode from Scale To Fill to Center. Before I changed the alpha and all it did was change the background to black. I figured perhaps the actual values were not scaling correctly, and I was correct. Again, simply change the mode from Scale To Fill to Center and voilà, it should work.

    0 讨论(0)
  • 2021-01-13 09:12

    In IB, click "Window" and make sure "Visible At Launch" is checked. Mine wasn't and my app finally appeared after checking that box.

    0 讨论(0)
  • 2021-01-13 09:13

    If you're building your window purely in code, be sure to remove the MainWindow.xib from the properties in your target.

    If that's not the problem, I have had similar issues before with apps behaving strangely on launch. I'm not sure what the root cause, so it's trial and error for me:

    1) Try deleting the build directory and rebuilding.

    2) Set the base SDK to iPhone Device 3.0. (The base SDK is overwritten when you build for the simulator anyway)

    3) I also had an issue one time where the project plist file and MainWindow.xib got deleted from my project accidentally, and it caused this identical issue. Double check to make sure they are in your project structure if you are using MainWindow.xib.

    0 讨论(0)
  • 2021-01-13 09:22

    I didn't have to change any alpha value settings. All I did was quit Interface Builder before trying to launch my project in the iPhone Simulator. For some reason if IB is open the first time you run the simulator it will give you a blank screen, so quit out of IB before running the project for the first time.

    0 讨论(0)
提交回复
热议问题