Ben Terry
Ben Terry

Reputation: 61

iphone app first tabview not showing tableview data

I have an App that has been working and selling in the App store for a while. I have decided to update it with a Webview. The App has a Tabbar across the bottom, the first two Tabs are Navigation Views with tables in them that drill down. The third tab is the new web view, and forth is a simple image and text.

Starting the app, I don't see any table in the first tab, all others work fine. If I swap the two navigation tabs around the one that wasn't working on tab one now works on tab 2, and the other way round.

I'm guessing its something to do with how the app is starting and showing the first view?

Let me know what code you need to see?

Answered myself in the end

I managed to figure out it was a loading problem for the first view and changed my App delegate to reflect this:

BEFORE:

 self.window.rootViewController = tabBarController;

AFTER:

[window addSubview:tabBarController.view];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];

I hope this helps someone else, it might not be the right way to do it, but it seems to work for me.

Upvotes: 1

Views: 172

Answers (1)

Ben Terry
Ben Terry

Reputation: 61

Answered myself in the end

I managed to figure out it was a loading problem for the first view and changed my App delegate to reflect this:

BEFORE:

 self.window.rootViewController = tabBarController;

AFTER:

[window addSubview:tabBarController.view];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];

I hope this helps someone else, it might not be the right way to do it, but it seems to work for me.

Upvotes: 1

Related Questions