Why does iOS development easily find out where the program crashes during debugging?

Source: Internet
Author: User
Cause

Many people commented on some crash messages and asked me what happened to the program. In fact, if you know where the code crashed, it would be easy to locate the problem. Android Developers can see which line of code has a problem by looking at the crash log, so how can I quickly find the specific line of code crash in iOS development.

Step 1

Add a general breakpoint in xcode. The method is as follows:

Click the project navigation breakpoint,

Step 2

Click +:

Follow the steps shown above to complete the operation.

Run the program again

The breakpoint automatically comes here,

The log information is:

11:14:19. 635 gesturerecognizer [1491: c07]-[_ nscfnumber is1_tostring:]: Unrecognized selector sent to instance 0x7a88df02013-05-20 11:15:21. 148 gesturerecognizer [1491: c07] *** terminating app due to uncaught exception 'failed', reason: '-[_ nscfnumber isequaltostring:]: Unrecognized selector sent to instance 0x7a88df'

This is easy to find that the program crashes because the value does not have the isequaltostring method.

If I do not add the above general breakpoint, the program will directly break the breakpoint to the main function.

PS: This method can only crash in most cases. A few errors cannot be broken.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.