views:

26

answers:

1

Here is my scenario. I have 3 out of 4 tab views that contain UIWebViews and UIImageViews. I have the UIImageView on top of the webView to provide a loading image and I remove the imageView when the delegate method webViewDidFinishLoad: is called. This works just fine.

The problem I am running into is trying to handle the method webView:didFailLoadWithError: if/when my web content fails to load. my webViews are different sizes for the 3 tabs so what I'm trying to do is if self.view equals one of my views (with webView) then add the subview (imageView) on the current view.

Basically I wan't to show an error image if the load fails in place of the loading image that is there for when the webView is loading. I do not know how to tell which view is currently loaded.

I hope this makes some sense.

+1  A: 

You can get the current view controller with -[UITabBarController selectedViewController]. Then use that view controller's view property.

Brian
Thanks so much for information Bongeh and Brian. This is exactly what I've been searching for.
tg2007