在我的
当我启动我的应用程序时,一切正常。当我通过邮件中的文件启动应用程序时,它会崩溃。不幸的是,我无法调试它,因为我无法模拟
appDelegate
中,当应用程序从i.e.邮件应用程序启动时,我有一些规格要求。当我启动我的应用程序时,一切正常。当我通过邮件中的文件启动应用程序时,它会崩溃。不幸的是,我无法调试它,因为我无法模拟
launchingOptions
。 目前,我构建和运行,然后断开iPad,关闭我的应用程序,然后转到邮件等... 有没有一种方法可以进行调试?
Appdelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
IntroViewController *introViewController = (IntroViewController *)self.window.rootViewController;
if (url !=nil) {
if ([url isFileURL]) {
introViewController.fileUrl = url;
}
}
NSLog(@"%@",[url path]);
return YES;
}
IntroViewController
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSLog(@"Hello");
if (fileUrl != nil) {
IntroTableViewController* introTable = (IntroTableViewController *)segue.destinationViewController;
introTable.openedByURL = [fileUrl path];
TabBarController* tabBarController = (TabBarController *)segue.destinationViewController;
UINavigationController* navigationController = (UINavigationController *)[[tabBarController viewControllers] objectAtIndex:0];
TargetLSController* targetViewController = (TargetLSController *)[[navigationController viewControllers] objectAtIndex:0];
NSString *urlPath = [fileUrl path];
targetViewController.currentFilePath = urlPath;
NSLog(@"%@",urlPath);
}
}
- (void)viewDidAppear:(BOOL)animated
{
[self performSegueWithIdentifier:@"Launch" sender:self];
NSLog(@"%@",fileUrl);
}