Der Speicher ist in diesem Code-Fragment undicht, wie dieses Speicherleck zu beheben?Iphone Speicherleck Problem?
-(NSDictionary *)sanitizedFinancialLine:(NSDictionary *)theFinancialLine
{
NSMutableDictionary *aFinancialLine = [NSMutableDictionary dictionaryWithDictionary:theFinancialLine];
for (id key in [aFinancialLine allKeys]) {
id something = [aFinancialLine objectForKey:key];
if ([something respondsToSelector:@selector(decimalValue)]) {
something = [NSDecimalNumber decimalNumberWithDecimal:[(NSNumber *)something decimalValue]]; // memory is leaking here
[aFinancialLine setObject:something forKey:key];
}
}
return [NSDictionary dictionaryWithDictionary:aFinancialLine];// and here
}
Es wäre gut für Sie, den Text Ihres Codes einzufügen, anstatt einen Screenshot zu machen ... –