Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, if there is a crash, there is a backtrace. Post it. Saw your edit; set a breakpoint on <code>malloc_error_break</code> and post the backtrace. Usually, such a malloc() failure indicates that you've either exhausted your 32 bit address space <em>or</em> you have caused a bogon value to be passed to malloc.</p> <p>Secondly, if you have a memory management issue, Instruments can help you track it down. Run your app using the Allocations instrument and try scrolling. It should be quite apparent what is being allocated either so frequently to cause such a crash.</p> <p>You said:</p> <blockquote> <p>The problem seems to be the part of where crayon is being set and getName is being called.</p> </blockquote> <p>If the problem has to do with <code>getName</code>, then please post the code for <code>getName</code>. As it is, there isn't anything in that code that seems obviously overly memory consuming.</p> <p>The <code>getName</code> method looks fantastically straightforward. :)</p> <hr/> <p>In the debugger console, if you type <code>b malloc_error_break</code>, it'll set the breakpoint. Or you can set the breakpoint as a "symbolic breakpoint" in Xcode's debugger window.</p> <p>Instruments is a different tool; you can "Run -> Run With Performance Tool -> Allocations" to run your app under instruments.</p> <p>However, given the entirely bogus value being passed to malloc(), I suspect something else has gone wrong.</p> <hr/> <p>That backtrace is actually quite useful. It indicates that the malloc() error is happening when the Cell is trying to allocate something related to setting the text.</p> <p><strong>And</strong> you also said that if you add <code>cell.textLabel.text = @"test";</code> then the error stops happening.</p> <p>My best guess; you are either over-releasing or corrupting the string that is supposed to be the rendered as the text of <code>cell.textLabel</code>.</p> <p>In particular, I'd bet that <code>crayon</code> is over-released or corrupt in certain circumstances. Try adding an <code>NSLog(@"crayon %@", crayon);</code> in your code and see if it barfs, too. And, as someone suggested, try running with Zombie detection enabled (Run -> Run with Performance Tools -> Zombie Detection; or whatever it is called).</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