Search code examples
objective-cios9

loadHTMLString warn "Null passed to a callee that requires a non-null argument" IOS9 Obj-C


I've just installed xcode 7 with ios 9.1 and I get this warning on a webview:

Null passed to a callee that requires a non-null argument

This is the code that fires the error:

-(void)viewWillDisappear:(BOOL)animated
{
    if(exitView)
        [ytView.webView loadHTMLString:nil baseURL:nil];
}

This way when the user goes back the webView (that plays a YT video) stops, it worked fine before, why does it gives this warning now? How can I fix it?


Solution

  • [ytView.webView loadHTMLString:"" baseURL: [NSURL URLWithString:@"http://"] ];
    

    taken from http://iaintheindie.com/2015/08/16/updating-apps-for-ios-9/

    regards