• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Solving memory leaks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Solving memory leaks
      • From: Philip Mobley <email@hidden>
References: 
 >Solving memory leaks (From: Michael Davey <email@hidden>)
 >Solving memory leaks (From: Michael Davey <email@hidden>)

  • Prev by Date: Solving memory leaks
  • Next by Date: Re: Solving memory leaks
  • Previous by thread: Solving memory leaks
  • Next by thread: Re: Solving memory leaks
  • Index(es):
    • Date
    • Thread