【发布时间】:2016-02-06 03:37:33
【问题描述】:
调试约束问题的绝妙技巧print the constraint`s id in lldb
但是我应该怎么做才能让 lldb 打印我的类别的描述呢?
@interface NSLayoutConstraint (Description)
@end
@implementation NSLayoutConstraint (Description)
-(NSString *)description {
return [NSString stringWithFormat:@"id: %@, constant: %f", self.identifier, self.constant];
}
@end
非常感谢您的帮助:)
【问题讨论】:
-
您永远不应该覆盖类别中的方法。这是未定义的行为。
-
@rmaddy 但链接说它有效......
-
它可能有效。它可能不会。这就是未定义行为的问题。
-
我再次测试,它只是工作...... :))
标签: objective-c xcode autolayout categories lldb