Core data managed object property retention
I seem to be having an issue with my managed objects not releasing memory. I have an NSOperation that downloads new information, saves it to a temp context, then merges it to the main context. All this works well but in the all开发者_StackOverflowocations instrument all the newly created properties stick around in memory after the merge is complete and the entire operation is deallocated. Is there any way to fix this? I've tried to reset both the temp and main contexts and refreshObject:, both don't fix this. Thanks!
Make sure that you create an NSAutoreleasePool
first thing in the operations main
. Before you return out of main make sure you drain
the pool. This includes returns before the end of the method such as inside an if statement.
精彩评论