есть ли лучший способ, чем этот? LoadRequest в методе killWebView - это способ избавиться от веб-страниц, таких как youtube. Я не хочу делать это так, но я не могу найти документацию о том, как выгрузить WebView ...
- (IBAction)killWebView:(id)sender
{
[self.webView stopLoading];
[self.webModal setHidden:YES];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];
}
- (IBAction)viewVideoLink:(id)sender
{
self.webModal.backgroundColor = [self randomColor:.4];
[self.webModal setHidden:NO];
NSString *strWebsiteUlr = [NSString stringWithFormat:[NSString stringWithFormat:@"%@", [self.model.currentTrackDictionary objectForKey:@"video_url"]]];
NSURL *url = [NSURL URLWithString:strWebsiteUlr];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:requestObj];
}