【问题标题】:iOS: Exception when poping a UIViewController with a UIWebViewiOS:使用 UIWebView 弹出 UIViewController 时出现异常
【发布时间】:2012-08-10 17:30:15
【问题描述】:

我有一个带有情节提要的小型 iOS 应用。初始视图控制器是一个带有 RootViewController 的 UINavigationController,它有一个 UIButton。我有一个从按钮到另一个带有 UIWebView 的视图控制器的 segue。我使用自动断点测试抛出的异常,当我推送 WebViewController 时,等到加载 pdf 然后按下“返回”按钮以弹出视图控制器,我得到一个没有任何控制台输出的异常。这个应用程序使用 ARC。我正在使用 Xcode 4.4.1,而在 Xcode 4.5 中我没有遇到异常。

ViewController.m
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"pdf"]){
        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://tonyromas.de/fileadmin/user_upload/Tonyromas_Drinks.pdf"]];
        [(WebViewController*)segue.destinationViewController setRequest:request];
    }
}
WebViewController.m
- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.wView loadRequest:self.request];
    // Do any additional setup after loading the view.
}


libobjc.A.dylib`objc_exception_throw:
0xeb2caa:  pushl  %ebp
0xeb2cab:  movl   %esp, %ebp
0xeb2cad:  pushl  %ebx
0xeb2cae:  pushl  %edi
0xeb2caf:  pushl  %esi
0xeb2cb0:  subl   $2028, %esp
0xeb2cb6:  calll  0xeb2cbb                  ; objc_exception_throw + 17
0xeb2cbb:  popl   %edi
0xeb2cbc:  movl   $16, (%esp)
0xeb2cc3:  calll  0xec7830                  ; symbol stub for: __cxa_allocate_exception

【问题讨论】:

    标签: objective-c ios exception uiwebview automatic-ref-counting


    【解决方案1】:

    这包括一个解决方法.. 但我相信他们的原始代码仍然是正确的(一目了然)。

    Displaying a PDF with UIWebView Not Working

    【讨论】:

    • 我很快就会去看看。谢谢。
    猜你喜欢
    • 2011-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-30
    • 2019-05-15
    • 1970-01-01
    • 2011-10-15
    • 2015-02-05
    相关资源
    最近更新 更多