我運行分析器,發現一些警告,我無法與代碼中的行關聯。我不知道如何處理它們。點擊它們會將我帶到編輯器中的正確文件,但分析器彙總結果告訴了我很多。我不知道它們各自所指的是什麼,並且逐行執行代碼並不是富有成效的(我不知道我在找什麼)。沒有詳細信息/行號的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