UIViewController挂在Xcode 7中 [英] UIViewController hangs in Xcode 7

查看:155
本文介绍了UIViewController挂在Xcode 7中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定标题是否正确,我在按钮单击时调用了newViewController,但它没有呈现出来.因为它在Xcode 6.4中工作正常,但是在Xcode 7中,它挂起了UI,并且在pushViewController之后没有显示新的视图控制器.

Not sure whether title is correct or not, I'm calling newViewController on button click but it is not rendering that. as it was working fine in Xcode 6.4 but in Xcode 7 its hangs the UI and not showing new view controller after pushViewController.

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

this is the error logs which print on console

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.

我在调用它但未加载该ViewController的下一个控制器的viewDidLoad中添加断点.

I add break point in viewDidLoad of next controller it is calling that but not loading that ViewController.

编辑

我看到CPU使用率为100%,第二点是我的Viewcontroller具有tableView,因此当我调试时,它将为所有行调用CellForRowatIndexPath,所以不确定它在哪里冻结了我的ViewController.

I seen that CPU usage are at 100% and second thing that my Viewcontroller have tableView so when i debug then it call my CellForRowatIndexPath for all the rows, so not sure where it exactly getting freezed my ViewController.

更新

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

I'm updating my question again, I removed that error constrains (i.e. 45 and 0) now I'm not getting any constrains warning or error on console but still my UIView is freezes. Please help Thanks

推荐答案

我也遇到了这个问题,它与占位符文本有关(我正在使用情节提要).清除字段中包含的所有占位符文本,然后查看它是否有效!我的如果有帮助,只需在代码中设置占位符文本,而不是在情节提要中.我在这里回答了类似的问题:

I had this problem as well and it had to do with placeholder text (I am using storyboard). Clear out any placeholder text you have in fields and see if it works! Mine does. If that helps, just set the placeholder text in code as opposed to storyboard. I answered a similar question here:

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

这篇关于UIViewController挂在Xcode 7中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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