CoreData leak when reading a property

Posted by Kamchatka on Stack Overflow See other posts from Stack Overflow or by Kamchatka
Published on 2010-12-27T14:37:21Z Indexed on 2010/12/27 17:53 UTC
Read the original article Hit count: 190

Hello,

I have the following code in a loop iterating over the different document objects:

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[document primitiveValueForKey:@"data"];
[data writeToFile:filename atomically:NO];
[document.managedObjectContext refreshObject:document mergeChanges:NO];
[pool release];

The "data" property is a large blob (a 1MB image). And as I monitor the memory with the Allocation Instrument memory usage is increasing. I cannot find where the leak is coming from and how to remove it.

Thanks!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about core-data