Check if URL Cached

Discussion in 'iOS Programming' started by computerartist, Dec 2, 2010.

  1. computerartist macrumors newbie

    Joined:
    Sep 4, 2010
    #1
    Hey everyone, I am just starting to use cached data in Apps and don't have much experience with it on the iPhone.

    I have an XML Parser and the App displays article names in a UITableView, and when the user clicks on the cell the article loads into a URL into a UIWebView. The second view uses NSURLConnection to display and animate a UIProgressBar, so what I was hoping to do was to check if the URL has been cached... if it has, then don't display the UIProgressBar.

    I was just wondering what a good starting point would be to research how to check if a URL that I am loading into a UIWebView has been cached?
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
  3. computerartist thread starter macrumors newbie

    Joined:
    Sep 4, 2010
    #3
    Yeah I have been looking at it... just didnt know if I have everything I need in this program to check for a cached URL instead of an image?
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    I believe you may need to adjust the code from that sample to handle URLs versus images.
     
  5. computerartist thread starter macrumors newbie

    Joined:
    Sep 4, 2010
    #5
    Sorry... yeah I know I will have to update the code some... but I guess I should have asked if both a URL and image will work with that sample code?
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Hmm, I'm still not understanding what you're asking exactly. And I think we've entered a bit of a gray area. A URL is not really a resource that you cache, unless you consider it a string. The resource that the URL points to can be cached, whether it be an image or HTML or XML or something else.
     

Share This Page