I see online lot of examples with the loadString called to load static HTML into UIWebView.
I’m trying to build the same in a prepareForSegue() function of my app.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
MYCLASSController *destViewController = segue.destinationViewController;
if ([segue.identifier isEqualToString:@"fromListToDetail"]) {
// let's suppose getHtmlTextForItem returns the NSString @"<b>Some HTML text</b> with formatting"
[destViewController.htmlText loadHTMLString: [db getHtmlTextForItem:bookId] baseURL:nil];
}
}
But It doesn’t load anything. Do you have any idea on how to solve this??? Am I doing something wrong?
Try loading the content in the viewDidLoad method of your class MYCLASSController.