2011-01-11 12 views
8

Ho appena aggiunto un semplice browser incorporato basato su UIWebView nella nostra app. Questo carica e naviga bene le pagine, ma non appena ruoto il dispositivo l'intera UI smette di rispondere. E ', tuttavia, ancora in corso e non posso mettere in pausa l'applicazione e stampare un backtrace:SendDelegateMessage non è riuscito a tornare dopo aver atteso 10 secondi

(gdb) bt 
#0 0x00f35bd4 in -[CALayer addAnimation:forKey:]() 
#1 0x00f283e3 in endChange() 
#2 0x00f2a535 in CALayerSetBounds() 
#3 0x00f2a2b6 in -[CALayer setBounds:]() 
#4 0x00573307 in -[UIView(Geometry) setFrame:]() 
#5 0x006c1a3a in -[UIWebDocumentView setFrame:]() 
#6 0x008aad59 in -[UIWebBrowserView setFrame:]() 
#7 0x006c1277 in -[UIWebDocumentView _updateSize]() 
#8 0x002a76c1 in _nsnote_callback() 
#9 0x019d4f99 in __CFXNotificationPost_old() 
#10 0x0195433a in _CFXNotificationPostNotification() 
#11 0x0029d266 in -[NSNotificationCenter postNotificationName:object:userInfo:]() 
#12 0x0196d67d in __invoking___() 
#13 0x0196d551 in -[NSInvocation invoke]() 
#14 0x027db82a in SendDelegateMessage() 
#15 0x027ba138 in WKViewSetBoundsSize() 
#16 0x02825628 in WebCore::ScrollView::platformSetContentsSize() 
#17 0x0282552b in WebCore::ScrollView::setContentsSize() 
#18 0x027d8ccc in WebCore::FrameView::setContentsSize() 
#19 0x027e8b27 in WebCore::FrameView::adjustViewSize() 
#20 0x027c68a4 in WebCore::FrameView::layout() 
#21 0x027dd1e0 in WebCore::Document::updateLayout() 
#22 0x027dd0fe in WebCore::Document::updateLayoutIgnorePendingStylesheets() 
#23 0x0285bc7b in WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue() 
#24 0x0285a768 in WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue() 
#25 0x02910963 in WebCore::CSSStyleDeclaration::getPropertyCSSValue() 
#26 0x0291017b in WebCore::JSCSSStyleDeclaration::nameGetter() 
#27 0x02053d1f in JSC::JSValue::get() 

a volte, ma non sempre, anche ottenere questo nella console:

void SendDelegateMessage(NSInvocation*): delegate (<CFNotificationCenter 0x5e199c0 [0x1a6a3e0]>) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode 

E questo è l'implementazione WebViewController:

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    backButton.enabled = NO; 
    forwardButton.enabled = NO; 

    pageTitle.title = [self.url absoluteString]; 
    [webView loadRequest:[NSURLRequest requestWithURL:self.url]]; 
} 

#pragma mark - 
#pragma mark UI Actions 

-(IBAction)doneButtonPressed:(id)sender { 
    [self dismissModalViewControllerAnimated:YES]; 
} 

#pragma mark - 
#pragma mark UIWebViewDelegate 

- (void)webViewDidStartLoad:(UIWebView *)aWebView { 
    [activityIndicator startAnimating]; 
    backButton.enabled = webView.canGoBack; 
    forwardButton.enabled = webView.canGoForward; 
} 
- (void)webViewDidFinishLoad:(UIWebView *)aWebView { 
    [activityIndicator stopAnimating]; 
    backButton.enabled = webView.canGoBack; 
    forwardButton.enabled = webView.canGoForward; 
    pageTitle.title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"]; 
} 

Qualcuno potrebbe far luce su questo?

+0

Questo sembra accadere solo nel simulatore e il dispositivo funziona bene. Anche se abbastanza fastidioso, posso aggirarlo. – rayh

+0

Non capisco completamente la tua domanda – Coder404

+0

Hey Ray! Stai caricando UIWebView in una vista modale? –

risposta

-2

vorrei controllare i vostri ivars, come suggerisce a me che quarantina stati rilasciati e il tentativo di eseguire un'operazione su un oggetto/puntatore nullo.

Problemi correlati