Possible Duplicate:
Xcode 4.2 showing the wrong line of code on error
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:
NSMutableArray * test = [[NSMutableArray alloc] initWithCapacity:5];
[test insertObject:@"Hello" atIndex:10];
When the app inevitably crashes, I'm taken to the main
function in main.m
with nothing on the call stack (the 'By Thread' view) to help me find what went wrong.
Is there a debugging setting I'm missing in the build properties, perhaps? This is Xcode 4.2 on Snow Leopard if it helps.
Thanks
Inspect the page. In the Safari on your Mac, on the Safari menu bar, choose the "Develop" menu. Scroll to the iOS Simulator option. Select the page for debugging.
When your apps keep crashing on your iPhone, updating them may just be the trick to solving it. To quickly check whether a specific app has an update, go to the App Store's Search tab to find the app. If an update is available, you'll see an Update button instead of the usual Open button. Tap on it to update the app.
Simulator doesn't try to exactly simulate the GPU from the iOS or tvOS device you are simulating. For example, if you are simulating the iPhone XS, Simulator does not try to emulate the capabilities of an A12 GPU. Instead, Simulator translates any calls you make and directs them to the selected GPU on the host Mac.
Go to the breakpoints panel, and add the bottom left, click the + sign and add an "Exception breakpoint".
Exceptions : All
Break : On throw.
That should solve the problem in most cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With