反过来ios应用程序直接打开应该从请求开始

我在我的主视图控制器中有一个webview,我正在使用viewdidload方法下载一个网页,如下所示:

- (void)viewDidLoad { [super viewDidLoad]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [_loginWebView loadRequest:requestObj]; } 

并在shouldstartloadwithrequest方法,我检查如果url包含“itunes”,我有以下代码:

 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ NSRange textRange4; textRange4 =[[[request URL] absoluteString] rangeOfString:@"itunes.apple.com"]; if(textRange4.location != NSNotFound) { UIApplication *app = [UIApplication sharedApplication]; NSString *newPath = [[request URL] absoluteString] ; if ([newPath rangeOfString:@"insider"].location != NSNotFound) { NSURL *myURL = [NSURL URLWithString:@"insider://"]; if ([app canOpenURL:myURL]) { [app openURL:myURL]; NSLog(@"insider"); } else { [app openURL:[NSURL URLWithString:newPath]]; } } else if ([newPath rangeOfString:@"reuters-news-pro-for-ipad"].location != NSNotFound) { [app openURL:[NSURL URLWithString:newPath]]; } else if ([newPath rangeOfString:@"thomson-reuters-marketboard"].location != NSNotFound) { NSURL *myURL = [NSURL URLWithString:@"marketboard://"]; if ([app canOpenURL:myURL]) { [app openURL:myURL]; NSLog(@"marketboard"); } else { [app openURL:[NSURL URLWithString:newPath]]; } } else { [app openURL:[NSURL URLWithString:newPath]]; } return NO; } return YES; } 

上面的代码工程,它打开我想要的应用程序,但是当我从ipad回到我的应用程序,而不是去mainviewcontroller,它重新打开以前打开的应用程序。 例如,如果我打开marketboard应用程序,它会重新打开,当我点击从家里的应用程序图标。 但以上只发生在ios5.0中,6.0中不会发生这真的很奇怪

这是默认的行为,当你在ios5.0中的webview的loadrequest在viewdidload方法,他们已经解决了它在ios6.0