Re: Solving memory leaks
Re: Solving memory leaks
- Subject: Re: Solving memory leaks
- From: mmalc Crawford <email@hidden>
- Date: Sun, 28 Mar 2010 10:42:59 -0700
On Mar 28, 2010, at 10:27 am, Michael Davey wrote:
> That would be gut for the fact that my fields are released and set to nil whenever a new SELECT query is executed - however, I think I can do this by emptying the array when a new query is done and just counting the size of the array in my fetch method - thanks...
>
Why not follow what someone else suggested earlier in the thread, and the pattern that is recommended in the documentation, and use accessor methods. As soon as you start sprinkling retains and releases throughout your code, you're liable to make a mistake.
<http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447>
On Mar 28, 2010, at 10:37 am, Michael Davey wrote:
> However, can anyone answer how I best go about either of the tasks that I have outlined as red, as they are leaking a lot of memory in comparison?
>
You best go about this by reading and understanding the memory management rules. There is no substitute for this. There really isn't much to them:
<http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994>
mmalc
_______________________________________________
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
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden