0

ある種のクラッシュが発生しました。クラッシュ スタックは次のとおりです。

 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)

および 2 つのコード:

- (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:)];
    ...
}

クラッシュは常にスーパーの init メソッドで発生します。なぜいつもクラッシュするのですか?助けてください!

4

2 に答える 2

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;
     }
}
于 2013-06-26T10:13:57.933 に答える