views:

299

answers:

1

I have a tab bar app but the first tab is an image with a button on it. Touching the button is supposed to push a web view. The other tabs are plain web views. Those work fine but every time I push to a new view, it's blank (except for the back button at the top.)

Questions:

Do I need an xib for the pushed web view?

Where does the loadRequest code go exactly? (I used awakeFromNib in the tab bar views)

When I hit the back button, is there a hook or some method I can add to to hide the top nav bar?

A: 

First, you never need a .xib for anything; you can always construct your views in code.

Second, what do you mean by "push a web view" and "push to a new view"? You are using a UINavigationController for that page, correct? So you are saying that initially the tab shows the correct page, but when you push a subview onto the stack it comes up blank?

I suspect the place you want loadRequest is in viewDidLoad, but I'd have to see what you are trying to do.

As for hiding the top navigation bar, are you looking for something like this:

self.navigationController.navigationBarHidden = YES;

If so, all you have to do is set that on the page for which you want the navigation bar to be hidden; it has nothing to do with the back button.

Amagrammer
Thx for your reply. I did get it working. I'm still getting a handle on these different views and controllers. I unfortunately don't have time to learn this "iPhone Way" properly as I'm under the gun. But I have made a lot of progress thanks to people like you.FYI, I realize the XIB can exist or not, now. I have gotten the navigation to work correctly, ie. the first view has buttons that take you to another view with a back button up in the left. And the first page is part of a tab bar with 2 other tabs that now go to web views just fine.
Troy Sartain
What I didn't get to work was hiding the nav bar at the top on the first view. The line of code you provided is what I'm using but I don't know where to put it. All the places I've tried have failed. Remember the first view (with a tab bar at the bottom) is part of the only nib and it creates another view programmatically and pushes it into view. When I go back, I want that nav bar at the top gone. So where to put the code...
Troy Sartain
(Sorry no quicker answer, I've been away) Let me look at a couple of things. I'll try to get you some help within a couple of days.
Amagrammer