当我登录时,我收到错误:
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];}@R_301_6120@ 这种方法已被弃用了很长一段时间
presentModalVIEwController:animated:
你应该使用它
presentVIEwController:animated:completion:
同样如此
dismissModalVIEwControllerAnimated:
现在我们使用它
dismissVIEwControllerAnimated:completion:
当我们不想要一个完成块时,我们只需将它设置为nil.
但在您的情况下,完成块可以解决您的问题…它确保了正确的事件序列,即在解雇完成之前不会进行呈现.
- (voID)logInVIEwController:(PFLogInVIEwController *)logInController dIDLogInUser:(PFUser *)user{ [self dismissVIEwControllerAnimated:YES completion:^{ NSLog(@"Successfully logged in."); CheckListsVIEwController *controller = [[CheckListsVIEwController alloc] initWithStyle:UItableVIEwStylePlain]; controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentVIEwController:controller animated:YES completion:nil]; }];}
[NB – modalTransitionStyle在原始代码中不正确,我也改变了.感谢Daniel G指出这个]
总结以上是内存溢出为你收集整理的ios – 正在进行演示时出席?尝试在Facebook登录后使用解析显示新视图.全部内容,希望文章能够帮你解决ios – 正在进行演示时出席?尝试在Facebook登录后使用解析显示新视图.所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)