이 내 appDelegate
에 있습니다. 앱이 Mail 앱의 파일로 시작될 때 몇 가지 사양이 있습니다.시뮬레이션 시작 옵션
내 앱을 실행하면 모든 것이 정상적으로 작동합니다. 메일에서 파일을 통해 앱을 실행하면 앱이 다운됩니다. 불행히도, 나는 시뮬레이션 할 수 없기 때문에 디버그 할 수 없다. 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);
}
콘솔이 해당 장치의 구성 도우미 창에서 계속 표시되지 않습니까? – deanWombourne
당신이 무엇을 의미하는지 모르겠습니다 ... – Faser
나는 NSLog가 Window-> Organizer에서 출력하는 것을 볼 수 있다는 것을 의미했습니다. 그러나 @ fichek의 대답은 내 생각보다 훨씬 낫다. :) – deanWombourne