Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是否正确解除presentViewController?_Ios_Objective C_Uinavigationcontroller_Modalviewcontroller_Presentviewcontroller - Fatal编程技术网

Ios 是否正确解除presentViewController?

Ios 是否正确解除presentViewController?,ios,objective-c,uinavigationcontroller,modalviewcontroller,presentviewcontroller,Ios,Objective C,Uinavigationcontroller,Modalviewcontroller,Presentviewcontroller,我无法正确关闭presentViewController,它正在创建一些约束-自动布局错误。我试图寻找这个问题,但没有一个解决方案解决了这个问题。这是描述 我有一个FirstViewController和一个SecondViewController 在FirstViewController中,我执行以下操作: SecondViewController *secondView = [story instantiateViewControllerWithIdentifier:@"secondView

我无法正确关闭presentViewController,它正在创建一些约束-自动布局错误。我试图寻找这个问题,但没有一个解决方案解决了这个问题。这是描述

我有一个FirstViewController和一个SecondViewController

在FirstViewController中,我执行以下操作:

SecondViewController *secondView = [story instantiateViewControllerWithIdentifier:@"secondView"];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:secondView];
[self.navigationController presentViewController:navigationController animated:YES completion:nil];
现在,在SecondViewController中,我有一个moveBack函数,该函数应移回FirstViewController:

-(void)moveBack{
    [self dismissViewControllerAnimated:YES completion:nil];
}
按下“后退”按钮后,将启动此后退操作。但当我这样做时,xcode会给我一些自动布局约束错误。具体错误是:

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

任何帮助都将不胜感激。谢谢

您的问题是解雇时出现了问题还是解雇时收到了此约束警告?您是否在代码中设置了
NSLayoutConstraint
?如果是,请显示代码。不,我在代码中没有使用NSLayoutConstraint。FirstView具有一些自动布局约束。但是我试着把它们去掉,警告也显示出来了@spectravideo328警告在解除后显示。您是否在界面生成器中使用了约束?是的,通过故事板。我添加了一些约束以使tableView保持在phone维度内。