0
我在下面的代碼泄漏。iPhone應用程序內存泄漏問題
cell.lblNoOfReplay.text=[NSString stringWithFormat:@"0 Replies. %@",(NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, (CFStringRef)[[NSString stringWithFormat:@"Last message on %@",[BabbleVilleAppDelegate dateByAddingHours:Babbleoffset withDate:[[arrayPMMainList objectAtIndex:[indexPath section]] objectForKey:@"datetime"]]] stringByReplacingOccurrencesOfString:@"+" withString:@" "], CFSTR(""), kCFStringEncodingUTF8)];
在這裏,我不還沒有分配任何字符串,但是當我檢查內存泄漏有在上述行一些泄漏。 可能是因爲kCFAllocatorDefault,所以有人遇到了同樣的問題,幫我解決。
問候 Mrugen
有那麼多關於這個怪物的代碼行,我建議你用一些臨時變量來分解它。這也將幫助你縮小泄漏。 – 2011-04-23 05:41:00