我运行分析器,发现一些警告,我无法与代码中的行关联。我不知道如何处理它们。点击它们会将我带到编辑器中的正确文件,但分析器汇总结果告诉了我很多。我不知道它们各自所指的是什么,并且逐行执行代码并不是富有成效的(我不知道我在找什么)。没有详细信息/行号的XCode分析仪警告
Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected
Incorrect decrement of the reference count of an object that is not owned at this point by the caller
Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected
Object sent -autorelease too many times
在过去的警告,我删除了自动释放,它走了,但我不知道如何释放它,因为它return语句中使用。
- (Client*) createNewClient {
...
Client *client = [NSEntityDescription insertNewObjectForEntityForName:@"Client"inManagedObjectContext:dataInterface.managedObjectContext];
...
return client;
}
一般情况下,我该怎么处理这些问题?
其中Xcode版本? – 2011-04-29 06:13:21
@Bavarious XCode版本4 – Jim 2011-04-30 00:49:41