I am facing the problem "MyViewcontroller using a NULL baseURL argument with the loadHTMLString baseURL method : data theorem"- i have successfully completed my task and all are working fine.
The Issue was in the OSWAP security scan for vulnerability it shows the above error.
My code snippet:-
NSString *aHtmlString = kEmptyString;
// Getting the bool from configuration plist
NSString *thePlistPath = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"plist"];
NSDictionary *theURLdata = [[NSDictionary alloc] initWithContentsOfFile:thePlistPath];
is
ServerFAQAvailable = [[theURLdata valueForKey:kIsServerFAQAvailableKey] boolValue];
if (one || two || three) {
aHtmlString = [self loadFAQFor];
} else {
aHtmlString = [self loadFAQForwithout];
}
NSURL *baseURL = [NSURL fileURLWithPath:thePlistPath];
[self.faqWebView loadHTMLString:aHtmlString baseURL:baseURL];
Update:
if (one || two || three) {
aHtmlString = [self loadFAQFor];
} else {
aHtmlString = [self loadFAQForwithout];
}
NSURL *baseURL = [NSURL fileURLWithPath:@"about:blank"];
[self.faqWebView loadHTMLString:aHtmlString baseURL:baseURL];
Still shows me scan issue
thePlistPath(and possiblytheURLdata), and verifying that you actually have a file at the location pointed to bythePlistPath. If you don't, then[NSURL fileURLWithPath:thePlistPath];will likely return nil andtheURLdatawill also likely be nil.ee,yyandii? please use clear variable names, also what's the values ofkConfigurationPlistNameandkPlistFormType? does that set the value ofthePlistPathproperly or is it Nil ?[NSURL new]inbaseURLparam.