Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView gets cleared after dismissing a fullscreen modal
    primarykey
    data
    text
    <p>I have a UIWebView which loads a html string on viewDidLoad. It detects if the user clicks a link and display a modal view, but when i close the modal view the UIWebView's html has gone! If i use a FormSheet Modal Style the content stays behind, its only fullscreen modals that cause this. Obviously i can just input the html string again on viewWillAppear which fixes it but this causes makes the content flick back on which i don't want. heres my code:</p> <pre><code>-(void)viewDidLoad { [self loadArticleText]; ... } -(void)loadArticleText { NSString *htmlHead = @"&lt;html&gt;&lt;head&gt;..."; NSString *htmlFoot = @"&lt;/body&gt;&lt;/html&gt;"; NSString *htmlContent = [self.articleData valueForKey:@"fulltext"]; NSString *html = [[NSString alloc] initWithFormat:@"%@%@%@", htmlHead, htmlContent, htmlFoot]; [self.articleView loadHTMLString:html baseURL:nil]; [html release]; } - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSURL *URL = [request URL]; ImageViewer *imageView = [[[ImageViewer alloc] initWithNibName:@"ImageViewer" bundle:nil] autorelease]; imageView.imageURL = URL; [self presentModalViewController:imageView animated:YES]; return NO; } else { return YES; } } </code></pre> <p>If i change 'return NO;' to 'return YES;' the webView contents stays, like it should, but obviously it loads the image.</p> <p>Any help?? </p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload