UIWebView init在ipad上崩溃

时间:2010-10-15 13:45:03

标签: iphone ipad uiwebview crash

我使用以下代码初始化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。请你提供任何线索吗?提前谢谢!

崩溃日志:

  flush1中的

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

     map_images_nolock中的

3 0x031c3784
map_images中的#4 0x031b5724中的#5 0x8fe03f2d

     

__ dyld__ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoE

     

6_ 0x8fe0decd in __dyld__ZN11ImageLoader4linkERKNS_11LinkContextEbbRKNS_10RPathChainE

     

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

     WebViewController.m上的

viewDidLoad]:55
#14 0x00525f85 in    - [UIViewController视图]
#15 0x0052439f in - [UIViewController contentScrollView]
#16 0x00532fee in - [UINavigationController   _computeAndApplyScrollContentInsetDeltaForViewController:]
#17 0x00531f40 in - [UINavigationController _layoutViewController:]
#18 0x00533f39 in - [UINavigationController _startTransition:fromViewController:toViewController:]
#19 0x0052dfa1 in - [UINavigationController _startDeferredTransitionIfNeeded]
#20 0x00673c8a in - [UILayoutContainerView layoutSubviews]
#21 0x02b10916 in - [CALayer layoutSublayers]
#CAL02erLayoutIfNeeded中的#22 0x02b10625
- #23 0x02b3b0e7 in - [CALayer   layoutIfNeeded]
#24 0x00527296 in - [UIViewController   window:willAnimateRotationToInterfaceOrientation:duration:]

     

25 0x004afef1 in - [UIWindow _setRotatableClient:toOrientation:duration:force:]
#26 0x00736425 in - [UIWindowController转换:fromViewController:toViewController:target:didEndSelector:]

     

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

     

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

     

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

     

42 0x00002dd8在main.m的主页面上:14

1 个答案:

答案 0 :(得分:0)

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