Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are leaking the <code>sqlite3</code> object, because you don't call <code>sqlite3_close</code> on it when <code>sqlite3_open</code> succeeds.</p> <p>Your method is named <code>getDataToDisplayTierOne:</code>. By <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html" rel="nofollow">Cocoa convention</a>, that method should return an object that the caller does <em>not</em> own. So you should be sending <code>autorelease</code> to <code>aTierOneData</code> before returning it. If you want the caller to own the returned object, you should name the method something like <code>newDataToDisplayTierOne:</code> or <code>mutableCopyDataToDisplayTierOne:</code>.</p> <p>We can't help you understand why your app crashes unless you show us the code that calls <code>getDataToDisplayTierOne:</code> and uses the returned dictionary.</p> <h3>Update</h3> <p>In <code>fetchDataForTierOne</code>, you are allocating/initing an empty <code>NSMutableDictionary</code>, storing a pointer to it in <code>myTierOneDict</code>, and then immediately leaking it by setting <code>myTierOneDict</code> to the return value of <code>getDataToDisplayTierOne:</code>. Why did you think you needed to store a pointer to an an empty dictionary in <code>myTierOneDict</code>?</p> <p>The code you posted doesn't send <code>release</code> or <code>autorelease</code> to the dictionary created in <code>getDataToDisplayTierOne:</code>, so you might be leaking that dictionary also.</p> <p>The code you posted doesn't send <code>release</code> or <code>autorelease</code> to the array that <code>myTierOneData</code> points to, so you might be leaking that also.</p>
 

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