NSLog(@"retainCount = %d means memory will%@be freed", [dataFromFile
retainCount], [dataFromFile retainCount] > 1 ? @" not " : @" ");
[dataFromFile release];
}
If you see any "will not be freed" messages in the console, then
dataFromFile has been retained, but either not released or
autoreleased somewhere inside the loop. Just one autorelease, instead
of release will cause the memory to be freed when the autorelease pool
is drained (way up in the main loop, if you haven't put one in place
somewhere closer to this code).
john
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com