views:

1883

answers:

14

I have an iPhone app that uses an UITabBarController, which contains two UINavigationControllers, each of which in turn contains one or more TableViewControllers (actually, customized UIViewControllers implementing UITableViewDelegate and UITableViewDataSource. ) On launch, it displays the UITabBarController with one of the tableviews displayed. Everything is coded; Interface Builder was NOT used to make any of the UI stuff. It was written in SDK 2. It worked fine in sdk 2.

I recently updated to SDK 3.0. In Info, I set the Base SDK setting to iPhone Simulator 3.0. Now, when I launch the application in Simulator, I see only a blank white screen with the status bar at the top. No signs of my app. However, when I exit the app, the missing tableview displays briefly as the exiting animation is playing. Also, on the blank white screen I can still click where the navigation buttons should be and find that, when I exit the app and the missing screen briefly displays, that navigation has taken me to another screen. So the buttons work, and presumably the tableviewcells are there, they just cannot be seen.

Has anyone seen anything like this? Does anyone have any idea what is causing it and how I can fix it? I noticed that sample apps, such as SQLiteBooks, seem to work fine when updating to SDK 3.0. My app isn't very much different from SQLiteBooks in terms of technologies used, except that, as I said above, I do not use Interface Builder.

Thanks

A: 

I have the exact same problem: 3.0 simulator shows blank screen, but the app seems to be running, as when I exit, I see its screen for a blink. I did not use IB, I suppose the problem might be somewhere with having a mainwindow.xib and a
window = [[UIWindow alloc] initWithFrame:CGRectMake(0,0,320,480)]; line at the same time. According to "iPhone SDK Release Notes for iPhone OS 3.0" having two windows is big dont. However I can't seem to get it work with only one of them. This is driving me crazy... If anyone knows the solution, please share...

It works with 2.2.1 device, and any 2.x simulator. Unfortunately I don't have 3.0 on device...

A: 

Did anyone solve this? I'm runnung into that now too.

+1  A: 

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.

Chris Garrett
+1  A: 

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

Jeff
This worked for me. For those who don't know how to do it:1. Double-click Resources/MainWindow.xib to open MainWindow in InterfaceBuilder.2. Select the 'window' in the MainWindow.xib UI. 3. Select Tools/Attribute Inspector in the Interface Builder main menu.4. alpha is the fifth value down in the attributes ui. The range is 0.00 - 1.00. Set it to 0.00. Save and close IB.
NoShitMcGee
A: 

another simple fix : kill that window ;-)

stefan nagel
A: 

Changing it to 0 did not work for me. Still seeing a blank white iPhone simulator screen. The only things in my app are a label and a jpeg image which appear in the Window, but not when I build and go.

A: 

After upgrading to the latest version of Xcode and iPhone simulator, I was still getting a blank screen. I found that by quitting Interface Builder before doing a Build and Go that the app would finally show up in the simulator.

+1  A: 

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.

Confirmed this, I had the exact same problem. Subsequent Build and Runs don't require you to have Interface Builder closed.
jnunn
A: 

I started experiencing this issue after upgrading to 3.0. I also found that quitting the IB before running Build and Go made it work for me.

Interesting to note that my previous applications would compile correctly even with IB on, so there seems to be some default setting on new projects that is causing this. If anyone comes across this, please let us know!

ron
A: 

After setting my alpha value to zero, now I get a blank BLACK screen

Ryan
+3  A: 

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

Mark
A: 

I also have this issue, I coud solved doing the following:

In Interface builder:

  • File's owner: is your application delegate
  • window: is the application's delegate window outlet

In XCode: - If you are using 3.0 or upper, comment this code line in your application delegate:

// window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]

G Mauri
A: 

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 whala, it should work.

youNOhooIamm
A: 

It appears you have to save the new interface before running. I have never developed for IPhone before and finally figured out why i was getting a white screen. Seems like it should save automatically before running but apparently it doesn't.

brian h