繁体   English   中英

iPad上的UIWebView初始化崩溃

[英]UIWebView init crash on ipad

我使用以下代码初始化UIWebView的实例:

-(void)viewDidLoad {

    [super viewDidLoad];

    UIWebView *webView;

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
      webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 768, 964)]; //crash
    } else {
      webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 380)];
    }   
}

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   // Return YES for supported orientations
   return YES;
}

这很奇怪,上面的代码在iphone模拟器上可以运行,但是会在ipad模拟器上崩溃。 我的xcode是3.2.4。 您能提供任何线索吗? 提前致谢!

崩溃日志:

在flushCaches中为0 0x031b5574
remethodizeClass中的#1 0x031b38fc
_read_images中的#2 0x031b60ea

map_images_nolock中的3 0x031c3784
#4 0x031b5724在map_images中
#5 0x8fe03f2d in

__dyld__ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoE

__dyld__ZN11ImageLoader4linkERKNS_11LinkContextEbbRKNS_10RPathChainE中的6 0x8fe0decd

__dyld__ZN4dyld4linkEP11ImageLoaderbRKNS0_10RPathChainE中的7 0x8fe056af
#8 0x8fe0b242在__dyld_dlopen中
#9 0x9754a868在dlopen中
initWebUILocalStorageSupport中的#10 0x0063b8e6
#[UIWebView _webViewCommonInit:]中的#11 0x0063a0d6
#12 0x0063abfd in-[UIWebView initWithFrame:]
#[WebViewController中的#13 0x0002c467

viewDidLoad]在WebViewController.m:55
#14 0x00525f85--[UIViewController view]
#15 0x0052439f--[UIViewController contentScrollView]
#16 0x00532fee-[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:]
#17 0x00531f40--[UINavigationController _layoutViewController:]
-[UINavigationController _startTransition:fromViewController:toViewController:]中的#18 0x00533f39
#19 0x0052dfa1--[UINavigationController _startDeferredTransitionIfNeeded]
-[UILayoutContainerView layoutSubviews]中的#20 0x00673c8a
-[CALayer layoutSublayers]中的#21 0x02b10916
CALayerLayoutIfNeeded中的#22 0x02b10625
#23 0x02b3b0e7 in-[CALayer layoutIfNeeded]
#24 0x00527296-[UIViewController窗口:willAnimateRotationToInterfaceOrientation:持续时间:]

-[UIWindow _setRotatableClient:toOrientation:duration:force:]中的25 0x004afef1
#26 0x00736425-[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:]

27 0x005297ac在-[UIViewController presentModalViewController:withTransition:]中
#28 0x00522e70 in

-[UIViewController _tryRecursivelyPresentModalViewController:withTransition:]
#[UIViewController presentModalViewController:withTransition:]中的#29 0x0052901d
#30 0x0002b8b4在-[TweetViewController showLocation:]在TweetViewController.m:608
-[UIApplication sendAction:to:from:forEvent:]中的#31 0x0048dcee
#[UIControl sendAction:to:forEvent:]中的#32 0x0050743e
-[UIControl(Internal)_sendActionsForEvents:withEvent:]中的#33 0x005098c0
#[UIControl touchesEnded:withEvent:]中的#34 0x0050846d
_UIGestureRecognizerUpdateObserver中的#35 0x0071aaad
__CFRunLoopDoObservers中的#36 0x03016a52
CFRunLoopRunSpecific中的#37 0x02fe3345
CFRunLoopRunInMode中的#38 0x02fe28a8

GSEventRunModal中的39 0x034d089d
GSEventRun中的#40 0x034d0962
UIApplicationMain中的#41 0x00498372

main在main.m:14处42 0x00002dd8

您是否更改了WebView initWithFrame? 这不是Webview的错,而是使用框架创建Webview的正确方法。 您可以发布控制器的其余部分吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM