2013-06-26 44 views
0

我遇到了某種崩潰的,這裏是崩潰堆棧:WebCore的崩潰

WebCore 0x353c81b4 WebCore::PageCache::markPagesForFullStyleRecalc(WebCore::Page*) + 20 
WebKit 0x36a6a45f -[WebView(WebPrivate) _initWithFrame:frameName:groupName:usesDocumentViews:] + 139 
WebKit 0x36a6a3cd -[WebView initWithFrame:frameName:groupName:] + 53 
WebKit 0x36a6a393 -[WebView initWithFrame:] + 47 
UIKit 0x37251bfb -[UIWebDocumentView initWithWebView:frame:] + 287 
UIKit 0x372828d1 -[UIWebBrowserView initWithWebView:frame:] + 57 
UIKit 0x37282891 -[UIWebDocumentView initWithFrame:] + 41 
UIKit 0x37282809 -[UIWebBrowserView initWithFrame:] + 49 
UIKit 0x37437d73 -[UIWebView _webViewCommonInitWithWebView:scalesPageToFit:shouldEnableReachability:] + 235 
UIKit 0x374385a9 -[UIWebView initWithFrame:] + 81 
SeMob 0x001c216d -[SeMobWebInternalView initWithFrame:] (SeMobWebInternalView.m:64) 
SeMob 0x001e7761 -[SeMobWebReader prepareReaderInWebView:] (SeMobWebReader.m:102) 
SeMob 0x000eeb0d -[SeMobWebView webViewDidFinishLoad:] (SeMobWebView.m:1475) 
CoreFoundation 0x346979c4 __invoking___ + 68 
CoreFoundation 0x345eefeb -[NSInvocation invoke] + 287 
CoreFoundation 0x345eeb43 -[NSInvocation invokeWithTarget:] + 51 
WebKit 0x36a6189b -[_WebSafeForwarder forwardInvocation:] + 375 
CoreFoundation 0x3469661b ___forwarding___ + 627 
CoreFoundation 0x345edf68 __forwarding_prep_0___ + 24 
CoreFoundation 0x346979c4 __invoking___ + 68 
CoreFoundation 0x345eefeb -[NSInvocation invoke] + 287 
WebCore 0x354197eb _ZL11SendMessageP12NSInvocation + 27 
WebCore 0x35456fa5 _ZL20HandleDelegateSourcePv + 81 
CoreFoundation 0x34669683 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15 
CoreFoundation 0x34668ee9 __CFRunLoopDoSources0 + 213 
CoreFoundation 0x34667cb7 __CFRunLoopRun + 647 
CoreFoundation 0x345daebd CFRunLoopRunSpecific + 357 
CoreFoundation 0x345dad49 CFRunLoopRunInMode + 105 
GraphicsServices 0x353432eb GSEventRunModal + 75 
UIKit 0x37220301 UIApplicationMain + 1121 
SeMob 0x000d48a7 main (main.m:12) 

和兩件代碼:

- (void)prepareReaderInWebView:(UIWebView *)webView 
{ 
// ...omit some code here 

    if ([readableContent length]) { 
     self.innerWebView = [[[SeMobWebInternalView alloc] initWithFrame:webView.bounds] autorelease]; 
     innerWebView.scalesPageToFit = NO; 
     innerWebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 
     innerWebView.scrollView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3]; 
     innerWebView.scrollView.scrollsToTop = YES; 
     innerWebView.delegate = self; 
     ... 
    } 


@interface SeMobWebInternalView : UIWebView 
- (id)initWithFrame:(CGRect)frame 
{ 
self = [super initWithFrame:frame]; 
if (self) { 
    // Initialization code 
    UIMenuItem *flag = 
    [[UIMenuItem alloc] initWithTitle:@"search" action:@selector(search:)]; 
    ... 
} 

崩潰始終在occers超級初始化方法。爲什麼它總是崩潰? Plz幫助我!

回答

0

由於@cosmin聲稱你並不是想要子類化UIWebView,所以你的代碼看起來像試圖定製外觀。試試這個代碼:

webView.backgroundColor = [UIColor clearColor]; // changes to clear colour 
webView.opaque = NO; 

for(UIView *innerView in [[[webView subviews] objectAtIndex:0] subviews]) { // Hide images that make shadow 
    if ([innerView isKindOfClass:[UIImageView class]]) { 
     innerView.hidden = YES; 
    } 
}