Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

UIWebView load from HTML string

$
0
0

Hi All,

Trying to load a UIWebView with the JSON response from a HTTP web service call.

Heres the code:

    void ConfigureView()
    {
        NSUrl exeUrl = NSUrl.FromFilename(NSBundle.MainBundle.BundlePath);

        // Update the user interface for the detail item
        if (IsViewLoaded && detailItem != null)
            myWebView.LoadHtmlString(detailItem.ToString(), exeUrl);
    }

It keeps telling me exeUrl is null and I get a null exception. I check the value for exeUrl and it is set correctly to the app file: file:///Users/grantcause/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/F589CA11-49EE-4E89-BB92-FC9D1382E719/SampleApp.app

I do note that LoadHtmlString wants a NSUrl:baseUrl and the baseUrl property of exeUrl is null but that is read-only so I cant set it. All the other properties of exeUrl are set i.e. AbsolutPath, etc. but I have tried using these and they dont work either it keeps saying it is null.

Any assistance would be greatly appreciated.

Regards,

Grant


Viewing all articles
Browse latest Browse all 204402

Trending Articles