iWizard
iWizard

Reputation: 7144

How to test where is app crashing?

I have app that sometimes crashes in navigating through Navigation bar and in console log is no error except this ->

(lldb)

How can I check where is error?

Upvotes: 1

Views: 623

Answers (4)

Mike Weller
Mike Weller

Reputation: 45598

See a recent answer I posted here:

When the debugger stops, go to the "Debug Navigator" and make sure the slider on the bottom is all the way to the right.

Scan your eye down from the point at which the exception is thrown and you should eventually come to your own code. Click on the appropriate method/function name and the code will be opened in the editor.

enter image description here

enter image description here

If you don't see any of your own methods in the stack trace, the exception may have been passed through a performSelector-style call in which case the stack trace is gone. If this is the case, you may get better information by adding an "On Throw" exception break point. First switch to the "Breakpoint navigator":

enter image description here

Then click on the plus and choose "Add Exception breakpoint..."

enter image description here

Create an "On Throw" break point:

enter image description here

This will stop the debugger at the exact point the exception is thrown, and you get a better stack trace. It's a good idea to have an exception break point like this enabled all the time.

Upvotes: 3

Kirby Todd
Kirby Todd

Reputation: 11566

Type bt at the lldb prompt and it will give you a stack trace telling where the app crashed.

Upvotes: 2

defactodeity
defactodeity

Reputation: 714

In Xcode, go to Product > Edit Scheme > Diagnostics > Enable Zombie Object

Now run the app and check the console.

Upvotes: 6

Saad
Saad

Reputation: 8947

try enable zombie objects from

produt>edit schems> enable zombi

Upvotes: 3

Related Questions