0

I've a very strange problem with my app. It runs perfectly on all Devices (even on iPad) running iOS 6.0. And with iOS 6.0.1 it runs also as expected on iPhone and iPod. But on iPad with 6.0.1 it crashes.

It's a very simple Single-View Application with a webView. This is my ViewControler.m:

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController


- (void)viewDidLoad
{
    NSURL *url = [NSURL URLWithString:@"http://telefonecke.tumblr.com"];
    NSURLRequest *req = [NSURLRequest requestWithURL:url];
    [_webView loadRequest:req];

    [super viewDidLoad];

}

-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest             navigationType:(UIWebViewNavigationType)inType {
if ( inType == UIWebViewNavigationTypeLinkClicked ) {
    [[UIApplication sharedApplication] openURL:[inRequest URL]];
    return NO;
}

return YES;
}

- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];

[_webView reload];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
}

- (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];

[[NSNotificationCenter defaultCenter] removeObserver:self         name:UIApplicationWillEnterForegroundNotification object:nil];
}

- (void)willEnterForeground {
    [_webView reload];
}

- (void)didReceiveMemoryWarning
{

    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

I actually don't know why it's not working, especially because it runs perfectly on iOS 6.0 and all other devices.

I'm thankful for every suggestion. Thanks in advance!

Edit: I also have a crash report, if it's helpful: click here for the crash report

4

1 回答 1

1

这是您崩溃的符号化 Last Exception Backtrace:

Last Exception Backtrace:
0   CoreFoundation                  0x327fb29e __exceptionPreprocess + 158
1   libobjc.A.dylib                 0x394dd97a objc_exception_throw + 26
2   UIKit                           0x38897d54 +[UIStoryboard storyboardWithName:bundle:] + 436
3   UIKit                           0x386da406 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 38
4   UIKit                           0x38563794 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 524
5   UIKit                           0x3850bc34 -[UIApplication handleEvent:withNewEvent:] + 1000
6   UIKit                           0x3850b6c8 -[UIApplication sendEvent:] + 68
7   UIKit                           0x3850b116 _UIApplicationHandleEvent + 6150
8   GraphicsServices                0x35c8759e _PurpleEventCallback + 586
9   CoreFoundation                  0x327d067e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 10
10  CoreFoundation                  0x327cfee4 __CFRunLoopDoSources0 + 208
11  CoreFoundation                  0x327cecb2 __CFRunLoopRun + 642
12  CoreFoundation                  0x32741eb8 CFRunLoopRunSpecific + 352
13  CoreFoundation                  0x32741d44 CFRunLoopRunInMode + 100
14  UIKit                           0x38562478 -[UIApplication _run] + 664
15  UIKit                           0x3855f2f4 UIApplicationMain + 1116
16  DieTelefonecke                  0x84f4e 0x83000 + 8014

您的应用程序调用0x84f4e是主要功能,因此无需担心。

所以加载主故事板时会发生异常。这就是您应该开始关注的地方,例如故事板是否是应用程序包的一部分等。

于 2012-12-14T21:01:56.823 回答