Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><em>Note : I have not had an opportunity to play with some of the newest features like ARC so this may or may not be out of date now.</em> </p> <p>Yes this could be an issue. According to Apple, this is one thing that they do check for. Nothing seems to guarantee rejection (or acceptance) by apple's review team, however. Perhaps more importantly, however, you want your reputation as an app developer to be good, you want to be in the business of making people's phones work <em>better</em> for them.</p> <p>Done right, you will always be to release any objects you have created with new or alloc.</p> <p>However to prevent, track down and eliminate memory leaks you need to use :<br> 1. analysis<br> 2. Instruments Leaks<br> 3. Your own analysis, and peer review when needed<br> 4. Clean coding, best practices and patterns</p> <p>While using Instruments Leaks profiling tool, use your app and try to hit all the different execution paths. See if objects appear as being leaked. I usually prioritize by total size of leak (object size * number of leaks), then work my way down until no leaks are showing up. Clicking on the object will show you somewhere near where the object originally gets allocated.</p> <p>I found that even Instruments might not catch all of the memory leaks explicitly.</p> <p>One more trick, that might help in this regard, is to reason out some different "loops" you can make in your app where, once you return "home" your app should have the same memory footprint as the last time you were there. For example, start at the home screen, carries out activity X, then activity Y, then return to the home screen. Lets say that you expect, after the first cycle, the 2nd and 3rd time you get back to the home screen, the memory foot print should be the same. You can then practice this with Instruments connected and the number of <em>allocations</em>. This can give you some valuable information.</p> <p>There are some interesting things that can happen with retention cycles, which can happen when you have a circular dependency between classes, and is easy to have happen when trying to do certain things with blocks.</p> <p>You might be tempted to ignore a warning about a memory leak, when the object persists for the lifetime of the app (like a singleton). My opinion is to eliminate the warnings and deallocate the object somewhere, as a matter of cleanliness.</p> <p>You will also feel very good about having zero compiler and zero analyser warnings when you build!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload