WebView Reresh

Discussion in 'Mac Programming' started by wgshiver, Jul 13, 2011.

  1. wgshiver macrumors newbie

    Jul 6, 2011
    Alright here is the problem I am having. I have a WebView coming up when the program loads. It loads the web page the first time just fine. When I try to refresh the page or reload it, it does nothing.

    Now if I create a button and put it on the window and link that to my function that refreshes the web page it works perfectly.

    What I need to do though is have the webpage refresh automatically at a certain time. There is a timer that goes off every 15 seconds. After 15 seconds it does a JSON request with a hash mark. If the hash mark it sends is different than the hash mark it receives back it needs to do a refresh of the content because that means there is new content to be loaded.

    This is a digital signage application if that helps. The whole idea is the Mac player checks for new content and if its there then it refreshes the web page.

    Is there a particular function of the WebView that I need to be calling. I tried the reload function but again it works fine if called with the click of a button. But if I try to call it through code it does nothing.
  2. wgshiver thread starter macrumors newbie

    Jul 6, 2011
    Got it fixed. I'm not sure exactly what I had wrong or what I did to fix it. I just kept changing things until it worked.
  3. WhateverIfeel macrumors newbie

    Jul 28, 2009

    Would you care to share how you did the automatic reloading? I am also in need of having a WebView reload its content after a JSON request, however I cannot get the reloading part to work.

    Greatly appreciated!

Share This Page