OGeek|极客世界-中国程序员成长平台

标题: ios - 如何通过其指针获取 NSLayoutConstraints 标识符? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 15:56
标题: ios - 如何通过其指针获取 NSLayoutConstraints 标识符?

我在 Storyboard identifier 中为每个约束设置:

enter image description here

现在我得到了 unsatisfiable 约束 的错误。我尝试通过打印约束的指针来调试它:

po 0x17db78d0

现在要调查它是什么约束,我想打印它的 identifier 就像:

po 0x17db78d0.identifer.

...但它不起作用。我收到一个错误:

error: hexadecimal floating constants require an exponent

error: 1 errors parsing expression

因此,如何打印特定 NSLayoutConstraint 的标识符?



Best Answer-推荐答案


po ((NSLayoutConstraint *)0x17db78d0).identifier

关于ios - 如何通过其指针获取 NSLayoutConstraints 标识符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31832423/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4