- (void) foo : (NSString*) ori_string
{
her_string = [ori_string copy];
while ([her_string length]>0)
{
her_string = [her_string substringFromIndex:1];
//do something...
}
[her_string release]; //Here is the problem
}
大家好,
如果我釋放her_string
像上面的分析說,it's an incorrect decrement of the reference count of an object that is not owned at this point by the caller
。
否則,如果我不釋放它,它說這是潛在的內存泄漏。
在哪裏以及如何釋放它?謝謝!
我完全明白了。謝謝邁克爾! – Skyler 2011-12-16 07:34:03