title: Debugging app crashes with iOS Simulator & XCode 4 halts in main() function, not crash source
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7973555/xcode-4-2-showing-the-wrong-line-of-code-on-error">Xcode 4.2 showing the wrong line of code on error</a>  </p>
  </blockquote>
  
  
  
  <p>Xcode 4's debugger doesn't seem to halt execution anywhere near the causes of crashes in iOS Simulator. Say I introduce a bug in my code, perhaps an array out of bounds error like this:</p>
  
  <pre><code>NSMutableArray * test = [[NSMutableArray alloc] initWithCapacity:5];
  [test insertObject:@"Hello" atIndex:10];
  </code></pre>
  
  <p>When the app inevitably crashes, I'm taken to the <code>main</code> function in <code>main.m</code> with nothing on the call stack (the 'By Thread' view) to help me find what went wrong.</p>
  
  <p>Is there a debugging setting I'm missing in the build properties, perhaps? This is Xcode 4.2 on Snow Leopard if it helps.</p>
  
  <p>Thanks</p>