是否有Xcode的工具或内置功能可以让我找到所有未使用过的ivars?
我看到静态分析器有CLANG_ANALYZER_OBJC_UNUSED_IVARS,但似乎没有做任何事情.
@implementation AppDelegate{@private BOol _foo; // Never read or written to}
使用设置为YES的CLANG_ANALYZER_OBJC_UNUSED_IVARS(未使用的ivars)在Xcode 5中运行分析器从不产生警告.
解决方法 基于 the relevant Clang source code和几个快速测试,似乎分析器不会查看未在@interface中声明并标记为@private的ivars.@interface Igloo : NSObject{ Nsstring * address; // No warning @private NSInteger radius; // Warning}@end@implementation Igloo{ NSInteger numwindows; // No warning @private // Has no real effect,of course; just testing Nsstring * doormatText; // No warning}@end
我建议提交错误/提交补丁.
总结以上是内存溢出为你收集整理的objective-c – 如何在Xcode中查找未使用的ivars全部内容,希望文章能够帮你解决objective-c – 如何在Xcode中查找未使用的ivars所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)