ios - Present while a presentation is in progress? Trying to display a new view after facebook login with parse. -
i'm trying nowadays uitableview i've made users set in info , save in parse. i'm pretty sure don't nowadays navigation view.
when log in, error:
checklists[4516:c07] warning: effort nowadays <checklistsviewcontroller: 0x10525e90> on <uinavigationcontroller: 0x9648270> while presentation in progress!
thanks help.
#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 } homecoming self; } - (void)viewdidappear:(bool)animated { [super viewdidappear:animated]; pfloginviewcontroller *login = [[pfloginviewcontroller alloc] init]; login.fields = pfloginfieldsfacebook; // need set delegate controller. login.delegate = self; login.signupcontroller.delegate = self; //signupcontroller property on 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]; }
this method has been deprecated while
presentmodalviewcontroller:animated:
you should utilize instead
presentviewcontroller:animated:completion:
same goes this
dismissmodalviewcontrolleranimated:
now utilize this
dismissviewcontrolleranimated:completion:
when don't want completion block, set nil.
but in case, completion block prepare problem... ensures right sequence of events, i.e. presenting won't take place until dismissing complete.
- (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 wrong in original code, have changed also. daniel g pointing out]
ios objective-c xcode
No comments:
Post a Comment