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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -