Load WebView from source string/data

Discussion in 'Mac Programming' started by ATG, Feb 27, 2007.

  1. ATG
    macrumors regular

    Joined:
    Aug 7, 2005
    #1
    I have some html source of a page I want to load into a WebView. However it is not in a file and so I can't just load from a URL. Is there any way to load a WebView directly from an NSString or NSData holding the source code?

    Thanks for any help :)
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Get the main frame via the obvious method and use the loadHTMLString:baseURL: method.

    That took me under 2 minutes to find in the documentation.
     
  3. ATG
    thread starter macrumors regular

    Joined:
    Aug 7, 2005
    #3
    Thanks :)

    Well good for you. I wasn't so fortunate
     

Share This Page