Wassim Ben Hssen
Wassim Ben Hssen

Reputation: 529

Detect which instruction may cause error in my app ios

I'm new with Ios programming Objective-C language and my app was working great until suddenly stop working and get this error

Xcode show me a generic error and i want to know which function or instruction produce this error i couldn't find how to do this with Xcode i want just to point the problem where it may come from

This is the error i got :

enter image description here

Upvotes: 1

Views: 63

Answers (2)

Hitesh Surani
Hitesh Surani

Reputation: 13537

Add Exception breakpoint

How to create exception breakpoints in Xcode?

Exception breakpoints are a powerful debugging tool that remarkably few people know about, so please read the following carefully and put it into practice!

A regular breakpoint is on a line you specify and causes the debugger to pause execution at that point so you can evaluate your program's state. An exception breakpoint tells the debugger to pause whenever a problem is encountered anywhere in your program, so you can evaluate your program's state before it crashes.

Exception breakpoints are trivial to set up: go to the Breakpoint Navigation (Cmd+8), then click the + button in the bottom left and choose Add Exception Breakpoint. You can leave it there if you want to, but it's preferable to make one further change to reduce unnecessary messages: right-click on your new breakpoint, choose Edit Breakpoint, then change the Exception value from "All" to "Objective-C".

Please follow the below steps.

Step 1

Step 2

Run your project.

Upvotes: 1

BhargavR
BhargavR

Reputation: 1133

Add Exception breakpoint

As shown in the image, select the 8th tab(Exception) and from the below add button, add the Exception Breakpoint. This will show the exact line of code from where the application crashes.

Upvotes: 4

Related Questions