关于iOS6的自动布局问题:"所有相关的约束应该已经从发动机上拆下来,并从视图的依赖制约和QUOT名单; [英] Autolayout issue on iOS6: "All dependent constraints should have been removed from the engine and also from the view's list of dependent constraints"

查看:169
本文介绍了关于iOS6的自动布局问题:"所有相关的约束应该已经从发动机上拆下来,并从视图的依赖制约和QUOT名单;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人遇到了自动布局与此警告消息:

Has anyone encountered this warning message related with autolayout:

All dependent constraints should have been removed from the engine and also from the view's list of dependent constraints

目前,我们有一些footerView几个按钮里面,它们被隐藏或呈根据需要。我们到处都使用全自动布局。下面是隐藏的方法/显示此footerView:

Currently, we have some footerView with several buttons inside and they are hidden or showed depending on the need. We use full autolayout everywhere. Here's the method for hiding/showing this footerView:

- (void)hideFooterView:(BOOL)shouldHide {

  self.containerViewBottomConstraint.constant = shouldHide ? 0 : 50; // expand  containing view to fit to full screen OR make it smaller to fit with footerView

  [UIView animateWithDuration:1 animations:^{
    [self.view layoutIfNeeded]; // animate expanding screen height to full height
    [self.footerView setAlpha:(shouldHide ? 0 : 1)];
  } completion:nil];  
}

所以,当这种方法被称为是第一次那么就没有错误消息。但第二次提到的警告后,将出现在控制台中。因为在其它屏幕,我们遇到了私人苹果的方法调用的崩溃没有任何线索,我们不能忽视这个警告如何解决:

So, when this method is called for the first time then there's no error message. But after the second time mentioned warning appears in console. We can't ignore this warning because in other screens we are encountering crashes with private Apple method calls without any clue how to solve that:

[UILayoutContainerView nsis_shouldIntegralizeVariable:]: message sent to deallocated instance

这里的另一个崩溃的消息:

here's another crash message:

[UILayoutContainerView nsis_valueOfVariable:didChangeInEngine:]: message sent to deallocated instance

我无法找到任何有用的相关nsis_valueOfVariable:didChangeInEngine:或网页自动布局相关限制的关键字。任何想法?

I was unable to find anything useful related to "nsis_valueOfVariable:didChangeInEngine:" or "Autolayout dependent constraints" keywords on web. Any ideas?

更新注释掉行[self.view layoutIfNeeded]似乎解决了该问题,但随后就没有动画...

UPDATE Commenting out line "[self.view layoutIfNeeded]" seems fixed the issue but then there will be no animation...

推荐答案

在我的项目也是这个问题来了。我得到同样的警告所有相关的约束应该已经从发动机上拆下来,并从视图的依赖限制名单。

In my project also this issue came. I was getting same warning "All dependent constraints should have been removed from the engine and also from the view's list of dependent constraints".

至于你说,当我忽略了它,并在其他屏幕我崩溃,显示

As you told, when I ignored it and in other screens I got crashes, showing

[UILayoutContainerView nsis_shouldIntegralizeVariable:]: message sent to deallocated instance

我发现,在我的情况我打电话 [self.view layoutIfNeeded] - (无效)viewWillDisappear:(BOOL)动画。当我删除了这一点,这个问题是固定的。
没有警告也没有崩溃。

I found that, in my case I was calling [self.view layoutIfNeeded] inside -(void)viewWillDisappear:(BOOL)animated. When I removed this out, the issue was fixed. No warnings and no crashes.

从这个我的理解是,如果我们调用 layoutIfNeeded 之前的观点正在被释放此警告会来的。而在明年的屏幕就会造成崩溃。

From this what I understood is, if we call layoutIfNeeded just before the view is being deallocated this warning will come. And in next screens it will cause crashing.

花了这么多的时间来搞清楚这个崩溃。这就是为什么我分享我的想法。

It took so much time to figure out this crash. That's why I am sharing my thoughts.

这可以帮助别人。

这篇关于关于iOS6的自动布局问题:"所有相关的约束应该已经从发动机上拆下来,并从视图的依赖制约和QUOT名单;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆