7
私はUITableViewを提示しようとしています。これは、ユーザーがデータを入れて解析するために作成したものです。私は、私がナビゲーションビューを提示しないと確信しています。あなたの助けのためのプレゼンテーションの進行中ですか?解析してFacebookのログイン後に新しいビューを表示しようとしています。
Checklists[4516:c07] Warning: Attempt to present <ChecklistsViewController: 0x10525e90>
on <UINavigationController: 0x9648270> while a presentation is in progress!
ありがとう:私がログインすると
は、私はエラーを取得します。
#import "LoginViewController.h"
#import "ChecklistsViewController.h"
#import "SetupViewController.h"
#import <Parse/Parse.h>
@interface LoginViewController()
@end
@implementation LoginViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
PFLogInViewController *login = [[PFLogInViewController alloc] init];
login.fields = PFLogInFieldsFacebook;
// Need to set the delegate to be this controller.
login.delegate = self;
login.signUpController.delegate = self; //signUpController is a property on the login view controller
[self presentModalViewController:login animated:NO];
}
- (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user
{
[self dismissModalViewControllerAnimated:YES];
NSLog(@"Successfully logged in.");
ChecklistsViewController *controller = [[ChecklistsViewController alloc] initWithStyle:UITableViewStylePlain];
controller.modalTransitionStyle = UITableViewStylePlain;
[self presentModalViewController:controller animated:YES];
}
ありがとう!非常に徹底的。あなたが気にしないならば、あなたのソリューションを実装した後にちょうど現れたもう一つのエラーがあります。 "警告:にを表示しようとしましたが、ビューはウィンドウ階層にありません!"これを見たことがない。 –
STANGMMX
@STANGMMX - あなたのアプリケーションについてもっと知る必要があります.'UINavigationController'(またはサブクラス)とは何を指していますか?おそらく、あなたのストーリーボードや他の手がかりなど、もう少し情報を表示する別の質問を提起するかもしれません。あなたのコードをviewDidAppearから移動することがあるかもしれませんが、あなたはログイン画面を却下するたびにviewDidAppearが呼び出されるので混乱します。または、BOOLフラグを立てて、あなたがそれを解消した直後にあなたのログイン情報を再提示しないようにしてください。 – foundry