Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would say you need to be very concerned. The first rule of programming is that the user will never do what you expect.</p> <p>Things to consider:</p> <ul> <li>Accessor methods. Use them. Set up properties for all attributes and always access them with the appropriate getter/setter methods:</li> </ul> <p>.</p> <pre><code>object.property = some_other_object; -OR- [object setProperty:some_other_object]; </code></pre> <p>and</p> <pre><code>object = some_other_object.some_property; object = [some_other_object some_property]; </code></pre> <p>Resist the temptation to do things like:</p> <pre><code>property = some_other_object; [property retain]; </code></pre> <ul> <li>Do you get output from ObjectAlloc? There are 4 tools from memory leaks, performance and object allocations. Are none of them loading?</li> <li>What do you get when the app crashes? EXEC_BAD_ACCESS or some other error?</li> <li>Balanced retain (either alloc or copy) and release. It is a good idea to keep every alloc/copy balanced with a release/autorelease in the same method. If you use your accessors ALL OF THE TIME, the need for doing manual releases is seldom.</li> <li>Autorelease will often hide a real problem. It is possible Autorelease can mask some tricky allocation issues. Double check your use of autorelease.</li> </ul> <p>EDITED (Added based on your fault code) Based on your above answer of "Program received signal: 0". This indicates that you have run out of memory. I would start by looking for instances that your code does something like:</p> <pre><code>myObject = [[MyClass alloc] init]; [someMutableArray addObject:myObject]; </code></pre> <p>and you do not have the "release" when you put the new object into the array. If this array then gets released, the object, myObject, will become an orphan but hang around in memory anyway. The easy way to do this is to grep for all of your "alloc"/"copy" messages. Except under exceedingly rare conditions, there should be a paired "release""/autorelease" in the same function. More often than not, the above should be:</p> <pre><code>myObject = [[[MyClass alloc] init] autorelease]; [someMutableArray addObject:myObject]; </code></pre>
 

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