开发者

XCode warns for unreleased objects

Is there a 开发者_Go百科way to make XCode warn for unreleased objects? It may be useful for classes with lots of objects and I forgot to put [obj release]; in the dealloc method.


You can use the Analyze tool ("Build and Analyze" in Xcode 3), which does static analysis and points out where you have unreleased objects. More detail here: Build and Analyze: running the analyzer within Xcode


It's not a compiler warning because it's valid Objective-C (though bad Objective-C), but if you use the static analyzer instead of the compiler, it can often detect cases where an object is leaked. (You still have to use the compiler to run your app, of course.)


I would recommend that you change your build settings to let it run everytime you compile your software.

How to turn it on: Select your project - Build Settings - Build Options - Run static Analyzer [YES]

XCode warns for unreleased objects

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜