Search code examples
objective-cipaduisplitviewcontrollermodalviewcontroller

Loading Modal View Controllar on Main View Controller Programmatically


I am creating a Ipad Application ,and so i have a Splitview as the Root View and now i want to add a user Login Screen (using Modal VC) , but the Problem is that i want load the Modal VC at view Did Load , just like in Ipad Settings app , so any body did something similar to that , or if anyone can suggest me something , Also i am using ARC and Stroyborads.


Solution

  • Try loading the view in viewDidAppear. Because the view isn't on screen yet in viewDidLoad, it conflicts with the other view you are trying to bring up.

    (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        [self presentModalViewController:];
    }
    

    Hope it helps!