KVC一致性测试
有没有类似于 LLVM 静态分析器的工具可以测试 Objective C 类是否 100% KVC 兼容?
Is there any tool, similar to LLVM's static analyzer, that wil test if an Objective C class is 100% KVC compliant?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑有很多类对于所有可能的键都符合 KVC。当您谈论 KVC 合规性时,您需要指定一个特定的密钥。如果您有一个键列表,那么很容易测试您的类是否符合 KVC 标准,但您还应该指定每个键是否表示属性、一对一关系、索引对多关系或无序对-很多关系。
也就是说,据我所知,您的问题的答案是:不,Xcode 中没有包含用于测试类的 KVC 合规程度的工具。不过,你肯定可以毫不费力地写一个。
I doubt there are many classes that are KVC compliant for all possible keys. You need to specify a particular key when you talk about KVC compliance. If you have a list of keys it's pretty easy to test whether your class is KVC compliant for each of them, but you should also specify whether each key represents an attribute, to-one relationship, indexed to-many relationship, or unordered to-many relationship.
That said, the answer to your question as far as I'm aware is: No, there is no tool included with Xcode that tests the degree of KVC-compliance of a class. You could surely write one without too much trouble, though.