0
votes

I am trying to move the new view controller from my current view controller i am using the following code to do this

self.loginView = [self.storyboard instantiateViewControllerWithIdentifier:@"LOGIN"];
[self presentViewController:self.loginView animated:NO completion:nil];

This code works fine for the iOS 8 but in iOS 7(iPhone) it is not working. Can someone help me so get rid of this error?

1
Are you getting any sort of error when running this in the iOS 7 simulator? - Kai Schaller
Presenting view controllers on detached view controllers is discouraged - Tarun Sharma
Sounds like this might do the trick: stackoverflow.com/questions/19890761/… - Kai Schaller
I have tried this but not working for me - Tarun Sharma
If you'd like to upload a small sample project that demonstrates the issue it would be easier to troubleshoot. It's difficult to diagnose the problem without being able to see what you're working with. - Kai Schaller

1 Answers

-1
votes

Please try to use [self.view.window.rootViewController presentViewController:self.loginView animated:NO completion:nil];