ios - Error when trying to present a Modal View Controller -
this question has answer here:
when trying present modal view controller programatically uitabbarcontroller getting following error: "warning: attempt present xyzloginviewcontroller on xyztabbarviewcontroller view not in window hierarchy!"
code follows:
+ (void) openwithviewcontroller:(uiviewcontroller*) controller anddelegate:(id) delegate { uistoryboard *sb = [uistoryboard storyboardwithname:@"loginsignup" bundle:nil]; xyzloginviewcontroller *vc = [sb instantiateviewcontrollerwithidentifier:@"xyzloginviewcontroller"]; vc.modaltransitionstyle = uimodaltransitionstylecoververtical; vc.delegate = delegate; [controller presentviewcontroller:vc animated:yes completion:nil]; }
i've tried executing app delegate, , in viewdidappear: method of tab bar controller hasn't helped.
i've looked @ many similar questions , had no luck far.
attempt present xyzloginviewcontroller on xyztabbarviewcontroller view not in window hierarchy
you should take warning , literally; means says. @ time making call, xyztabbarviewcontroller's view not in app's window anywhere. you've created instance, view not in window. if there is xyztabbarviewcontroller's view in window, must different xyztabbarviewcontroller's view.
it comes down controller
in code showed. since didn't show controller
comes from, or else you've done it, there no more said.
Comments
Post a Comment