UIViewController在Xcode 7中挂起

不知道是否标题是正确的,我打电话给newViewControllerbutton点击,但它没有渲染。 因为它在Xcode 6.4中工作正常,但是在Xcode 7中它挂起了UI,并且在pushViewController之后没有显示新的视图控制器。

这是在控制台上打印的错误日志

Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "<NSLayoutConstraint:0x16bbe0c0 V:[UIView:0x157fb230(45)]>", "<NSLayoutConstraint:0x16bbc390 V:[UIView:0x157fb230(0)]>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x16bbe0c0 V:[UIView:0x157fb230(45)]> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful. 

我在下一个控制器的viewDidLoad添加断点,它正在调用,但不加载该ViewController。

编辑

我看到CPU的使用率是100%,第二件事是我的ViewController有tableView,所以当我debugging,然后调用我的CellForRowatIndexPath所有的行,所以不知道它确切地说是冻结我的ViewController。

UPDATE

我再次更新我的问题,我删除了错误约束(即45和0)现在我没有得到任何约束警告或控制台上的错误,但仍然我的UIView冻结。 请帮忙谢谢

您的某个视图看起来好像有两个相互冲突的高度限制。 一个是告诉你的观点有0个高度,另一个告诉它有45个。

也与错误消息无关:您不需要“将中心Xalignment到超视图”约束,因为由于前导/尾随约束,这将是隐含的。

编辑:

尝试实现下面的初始化,并用[MyViewControllerClass new]实例化它。 以前我用viewcontroller默认的行为加载一个与视图控制器名称相同的nib。 这当然假设你没有使用故事板,在这种情况下,我真的不能帮助。

 - (instancetype)init { self = [super initWithNibName:@"MyNibName" bundle:nil] if (self) { } return self } 

我也有这个问题,它必须做占位符文本(我正在使用故事板)。 清除你在字段中的任何占位符文本,看看它是否工作! 我的。 如果有帮助,只需在代码中设置占位符文本,而不是故事板。 我在这里回答了类似的问题:

实例化模式视图控制器冻结应用程序 – 可能的问题与Xcode 7