Apple 会在自动布局警告时拒绝我的应用吗?

Will apple reject my app on autolayout warnings?

提问人:Krunal 提问时间:1/31/2013 最后编辑:Bryan ChenKrunal 更新时间:12/15/2016 访问量:1511

问:

我制作了针对 iOS 6 的 iPhone 应用程序

我的应用程序运行非常流畅,在启动期间和应用程序中的任何位置都没有崩溃。但是我的应用程序显示了一些与 .autolayout

我尝试了很多来解决这个警告,但我没有成功。

NSLog 中的警告:

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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0xac85e50 h=-&- v=-&- UIViewControllerWrapperView:0xac745f0.height == UINavigationTransitionView:0xab9b110.height - 64>",
    "<NSLayoutConstraint:0xac71d60 V:[UITableView:0xb161200(307)]>",
    "<NSLayoutConstraint:0xac73230 UITableView:0xb161200.bottom == UIView:0xac72b20.bottom>",
    "<NSLayoutConstraint:0xac731b0 V:|-(>=153)-[UITableView:0xb161200]   (Names: '|':UIView:0xac72b20 )>",
    "<NSAutoresizingMaskLayoutConstraint:0xac84610 h=-&- v=-&- UIView:0xac72b20.height == UIViewControllerWrapperView:0xac745f0.height>",
    "<NSAutoresizingMaskLayoutConstraint:0xabcac10 h=-&- v=-&- UILayoutContainerView:0xc085ad0.height == UIWindow:0xc06c990.height>",
    "<NSAutoresizingMaskLayoutConstraint:0xabcca20 h=--- v=--- V:[UIWindow:0xc06c990(568)]>",
    "<NSAutoresizingMaskLayoutConstraint:0xabc8dd0 h=-&- v=-&- UITransitionView:0xc086e40.height == UILayoutContainerView:0xc085ad0.height - 49>",
    "<NSAutoresizingMaskLayoutConstraint:0xabc7660 h=-&- v=-&- UIViewControllerWrapperView:0xab9b5d0.height == UITransitionView:0xc086e40.height>",
    "<NSAutoresizingMaskLayoutConstraint:0xabc42e0 h=-&- v=-&- UINavigationTransitionView:0xab9b110.height == UILayoutContainerView:0xab9b190.height>",
    "<NSAutoresizingMaskLayoutConstraint:0xabc5a00 h=-&- v=-&- UILayoutContainerView:0xab9b190.height == UIViewControllerWrapperView:0xab9b5d0.height>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0xac71d60 V:[UITableView:0xb161200(307)]>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

由于此警告,如果我将应用提交到 App Store,它会被拒绝吗?

iPhone iPad iOS6 警告 nslayoutconstraint

评论

3赞 Bryan Chen 1/31/2013
为什么不尝试解决问题呢?
0赞 Krunal 1/31/2013
我尝试了很多来解决这个警告,但我没有成功。:(
0赞 Bryan Chen 1/31/2013
阅读本文,以便弄清楚此约束来自何处,并可能将其删除Will attempt to recover by breaking constraint <NSLayoutConstraint:0xac71d60 V:[UITableView:0xb161200(307)]>
0赞 Bart Jacobs 1/31/2013
我同意@xlc0212。诚然,自动布局警告似乎令人生畏,但问题本身通常非常微不足道。如果您希望创建和发布可靠的应用程序,那么我建议调试此问题以尝试解决此问题。

答:

6赞 Ilker Baltaci 1/31/2013 #1

Apple 在审批过程中不会考虑警告。动态检查会查找未记录的方法、私有 API 等。然后还检查内容。由于我的代码中有第三方库,我也有一些警告,并且我的应用程序都没有因警告而被拒绝。