The meaning of Xcode hints when failures occur

1.When my application crashes and there is no message in the console window, Xcode shows me a green line with the EXC_BAD_ACCESS or PROGRAM RECEIVED SIGNAL SIGABRT signature in the code editor. The question is: does Xcode always put this green line in the line of code where the error is placed? If I see this green line placed on a line

[myObject myMethod]; 

Can I be sure that the error must be found inside the myMethod function? Or maybe it could mean something else?

2. Sometimes this green line is placed inside the main.m file in the line

 int retVal = UIApplicationMain(argc, argv, nil, nil); 

Do you know what specifically relates to the placement of the hint? What does it mean?

3. Sometimes a strange thing also happens: Xcode shows me a file with assembler code and a green line inside this code. What for? What should I understand when I see this?

4. If I repeat the following: enter the screen, then do something, then close the screen - my application will crash. It may fall a second time or on the seventh. What are the most common causes of such a crash? Memory leak? But Analyze tells me there are no leaks in my application. What do you think it could be?

+4
source share
3 answers

As I said in another post:

In Xcode, go to the Edit Scheme menu, select the current configuration and add “NSZombieEnabled”, as in the image below, when your applications crashes, this will provide you with additional information about the crash, which should help you debug it.

enter image description here

Note that when debugging your application is complete, remove the NSZombieEnabled command, as it affects application performance.

+1
source

You can check NSZombies or debug any memory links that you might find in the error message.

Here you can find some tips on debugging iPhone Xcode

Regarding (3), I don't think there is a way to interpret this assembler code.

+1
source

A simple answer to point 4: The most common reason for access to freed / re-released memory access failure.

+1
source

Source: https://habr.com/ru/post/1385341/


All Articles