Don't set scale and loadHTMLString on nil.

This commit is contained in:
Alok Sahay 2015-03-16 17:00:01 +01:00
parent 9bdf758d5a
commit 80576b5903
1 changed files with 2 additions and 0 deletions

View File

@ -164,6 +164,7 @@ static std::string getFixedBaseUrl(const std::string& baseUrl)
}
- (void)loadHTMLString:(const std::string &)string baseURL:(const std::string &)baseURL {
if (!self.uiWebView) {[self setupWebView];}
[self.uiWebView loadHTMLString:@(string.c_str()) baseURL:[NSURL URLWithString:@(getFixedBaseUrl(baseURL).c_str())]];
}
@ -211,6 +212,7 @@ static std::string getFixedBaseUrl(const std::string& baseUrl)
}
- (void)setScalesPageToFit:(const bool)scalesPageToFit {
if (!self.uiWebView) {[self setupWebView];}
self.uiWebView.scalesPageToFit = scalesPageToFit;
}