当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Dismissing presentViewController properly?

问题描述:

I am unable to dismiss a presentViewController properly, it is creating some constraint - autolayout errors. I tried searching for this issue, but none of the solutions resolved the problem. Here's the description..

I have a FirstViewController and a SecondViewController.

From FirstViewController I do the following :

SecondViewController *secondView = [story instantiateViewControllerWithIdentifier:@"secondView"];

UINavigationController *navigationController =

[[UINavigationController alloc] initWithRootViewController:secondView];

[self.navigationController presentViewController:navigationController animated:YES completion:nil];

Now in SecondViewController I have a moveBack function which should move back to FirstViewController:

-(void)moveBack{

[self dismissViewControllerAnimated:YES completion:nil];

}

This moveBack is initiated on pressing a back button. But when I do it xcode gives me some autolayout constraint errors. The specific error is :

Probably at least one of the constraints in the following list is one you don't want.

Any help would be appreciated. Thanks!

分享给朋友:
您可能感兴趣的文章:
随机阅读: