UIWebView init crash на ipad - PullRequest
       20

UIWebView init crash на ipad

0 голосов
/ 15 октября 2010

Я использовал следующий код для инициализации экземпляра 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.Не могли бы вы предоставить любую подсказку?Заранее спасибо!

Журнал аварий:

0 0x031b5574 в flushCaches
# 1 0x031b38fc в remethodizeClass
# 2 0x031b60ea в _read_images

3 0x031c3784 в map_images_nolock
# 4 0x031b5724 в map_images
# 5 0x8fe03f2d в

__ dyld__ZN4dyldL18notifyBatchPartialE17dyld_image_statesbPFPKcS0_jPK15dyld_image_infoE

6 0x8fe0decd в __dyld__ZN11ImageLoader4linkERKNS_11LinkContextEbbRKNS_10RPathChainE

* * 1023 70x8fe056af в __dyld__ZN4dyld4linkEP11ImageLoaderbRKNS0_10RPathChainE

# 8 0x8fe0b242 в __dyld_dlopen * тысячу двадцать-пять * # 9 0x9754a868 в dlopen
# 10 0x0063b8e6 в initWebUILocalStorageSupport * тысяча двадцать семь * # 11 0x0063a0d6 в - [UIWebView _webViewCommonInit:]
# 12 0x0063abfd в - [UIWebViewinitWithFrame:]
# 13 0x0002c467 в - [WebViewController

viewDidLoad] в WebViewController.m: 55
# 14 0x00525f85 в - [представление UIViewController]
# 15 0x0052439f Просмотр в -]
# 16 0x00532fee in - [UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] *
# 17 0x00531f40 in - [UINavigationController _layoutViewController:]
# 18 Контроллер igation Контроллерin - [UINavigationController _startDeferredTransitionIfNeeded]
# 20 0x00673c8a in - [UILayoutContainerView layoutSubviews]
# 21 0x02b10916 в - [CALayer layoutSublayers]
# 22 0x0503BeeBeBeBeBeNeBeBeNeBeBeBeBeBeNeBeBeBeNeBeBeBeNeBeBeBeNeBeR.
# 24 0x00527296 in - [Окно UIViewController: willAnimateRotationToInterfaceOrientation: duration:]

25 0x004afef1 in - [UIWindow _setRotatableClient: toOrientation: duration: Force *: 0: 266: 0: 0: 0: 0: 0): 0: 4: 0: 0: 0: 0: 0: 0: 0 *.UIWindowController transition: fromViewController: toViewController: target: didEndSelector:]

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

- [UIViewController _tryRecursivelyPresentModalViewController: withTransition:] *
# 29 0x0052901d в - [UIViewController presentModalViewController: withT переход к объекту: TLT: 0 * 054)m: 608
# 31 0x0048вход в - [UIApplication sendAction: to: from: forEvent:]
# 32 0x0050743e in - [UIControl sendAction: to: forEvent:]
# 33 0x005098c0 in - [UIControl (Внутренний38 0x02fe28a8 в CFRunLoopRunInMode

39 0x034d089d в GSEventRunModal
# 40 0x034d0962 в GSEventRun
# 41 0x00498372 в магистрали UIApplicationMain * 10682 * 06800

* 689: 14

1 Ответ

0 голосов
/ 15 октября 2010

Вы что-то изменили в WebView initWithFrame?Это не вина веб-просмотра, это правильный способ создать его с помощью фрейма.Не могли бы вы опубликовать остальную часть контроллера?

...