Storyboardを使用してIOS5.1でアプリケーションを完成させようとしています。基本的に私はドロップボックスアプリをやっています。Dropbox SDKを使用しているため、DropboxへのリンクはAppDelegate.mで処理されます。ユーザーは、セッションからリンクを解除して、別のViewControllerで再度リンクできるようにするオプションがあります。したがって、ユーザーリンクとリンクされていないアプリがビューをAppdelegateからrootviewcontrollerに接続されていないViewControllerに切り替える必要があるたびに
元のDropboxの例では、Dropboxは次のコードのように遷移を処理しました
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
if ([[DBSession sharedSession] handleOpenURL:url]) {
if ([[DBSession sharedSession] isLinked]) {
[navigationController pushViewController:rootViewController.photoViewController animated:YES];
}
return YES;
}
return NO;
}
しかし、Navigation ControllerでStoryboardを使用していて、次のメソッドのいずれかが機能していません。コメントにメソッドを入れました。
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
if ([[DBSession sharedSession] handleOpenURL:url]) {
if ([[DBSession sharedSession] isLinked]) {
NSLog(@"App linked successfully!");
// At this point you can start making API calls
/*UIViewController *viewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:NULL] instantiateViewControllerWithIdentifier:@"MeetingViewController"];
[self.navigationController pushViewController:viewController animated:YES]; */
//[self performSegueWithIdentifier:@"xxxx" sender:self];
/* LoginDropboxViewController *loginController=[[LoginDropboxViewController alloc] initWithNibName:@"LoginDropbox" bundle:nil];
[navigationController pushViewController:loginController animated:YES]; */
}
return YES;
}
// Add whatever other url handling code your app requires here
return NO;
}
これがアプリのストーリーボードです
では、AppDelegate.hでビューを切り替えるにはどうすればよいですか?
注:セグエを追加してセグエに名前を付けると、goToMeeting [self PerformSegueWithIdentifier:@ "goToMeeting" sender:self];と言うことができます。
私が得るエラーは:No Visible @interface for 'AppDelegate' declares the selector performSegueWithIdentifier:sender