webViewDidFinishLoading help

Discussion in 'iOS Programming' started by bobbypotluck, Jun 24, 2010.

  1. bobbypotluck macrumors member

    Feb 18, 2009
    I'm trying to add an activity indicator over a uiwebview in order to show that the page is loading. The UIwebview is loading a googleMap URL which takes a while to load. I also need to make the network indicator show that the page is loading as well.

    Currently i have the activity indicator view declared in my appDelegate and have it hidden. I would like to use the webViewDidFinishLoading method within each viewController file. My understanding is that i should use this method to change indicator.hidden to TRUE or FALSE using if else statements. I thought all i would have to do is import the appDelegate file into each viewController file but every time i get the error that my indicator has not been declared.

    Should i declare a new activity indicator in each viewController file? I'm having trouble making it show up that way. The only way i can get the activity indicator to show up at all is to declare it in my AppDelegate file, but it does not go away after the page loads.

    I'm using a tab based app to switch views in case that helps. What's the best strategy for this? I'm not having much luck with webViewDidFinishLoading. Is it possible to declare this method in the AppDelegate instead of the viewController files? Any help or links to examples is much appreciated to get me started in the right direction.
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Is your indicator declared public in your appDelegate?

Share This Page