Swift Autolayout 警告和其他我不理解的警告

Swift Autolayout warnings and other warnings i do not understand

该应用程序允许用户 post images/follow 其他

所以它工作正常,但我收到以下警告: (我知道有些与 AutoLayout 约束有关,但我怎么知道是什么导致了问题?)

2015-07-05 17:19:37.701 Pixym[1271:72192] CUICatalog: Invalid asset name supplied: 

2015-07-05 17:19:37.702 Pixym[1271:72192] Could not load the "" image referenced from a nib in the bundle with identifier "HP.Pixym" 

2015-07-05 17:19:37.705 Pixym[1271:72192] 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:0x7fa83b822a40 H:[UIImageView:0x7fa83b8529a0(300)],
 NSLayoutConstraint:0x7fa83b85ccb0 H:[UIImageView:0x7fa83b8529a0]-(10)-|   (Names: '|':UITableViewCellContentView:0x7fa83b871ff0 ),
 NSLayoutConstraint:0x7fa83b8643d0 H:|-(10)-[UIImageView:0x7fa83b8529a0]   (Names: '|':UITableViewCellContentView:0x7fa83b871ff0 ),
 NSLayoutConstraint:0x7fa83b80ab00 'UIView-Encapsulated-Layout-Width' H:[UITableViewCellContentView:0x7fa83b871ff0(375)])

Will attempt to recover by breaking constraint 
NSLayoutConstraint:0x7fa83b822a40 H:[UIImageView:0x7fa83b8529a0(300)]

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.

如有任何帮助,我们将不胜感激。

从约束来看,您似乎有一个宽度为 300 且左右填充为 10 的 imageView。这在 iPhone 5(屏幕宽度为320) 但它会在 iPhone 6/ 6 Plus 上崩溃,因为那里的宽度更大。

您需要做的是弄清楚图像在所有屏幕上的显示效果。 10 像素的内边距是否比宽度更重要,还是您希望它的宽度始终为 300?

如果您想要宽度,请删除其他 2 个约束并为图像在容器约束中添加水平居中。

在另一种情况下,只需删除宽度限制即可。

祝你好运!