Xcode crash, memory leak check method

Source: Internet
Author: User

Project-profile


Reproduced from: http://blog.csdn.net/zzh_gaoxingjiuhao/article/details/7830864

Secret:

1. If the crash is inside the MAIN.M, you can set the global exception breakpoint (Exception breakpoint).

2. You are not getting useful information in the state where the exception breakpoint is turned on. In this case, run the app a few more times, or enter the "PO $eax" command after the debugging prompts.

3. The general cause of most crashes and some bugs are missing or wrong connections in your xib or storyboard. These situations do not appear in the compilation error, so you generally do not know.

4. Do not ignore compilation warnings. If you have a compile warning, you may have something wrong. If you don't know why you're going to a compile warning, it's best to figure it out. These are safe practices!

5. Debugging on the device may be slightly different from the one on the simulator. These two environments are not exactly the same, and you will get different results.

For example, when you run a problematic program on iphone4, the first crash occurs when Nsarray initializes, because you lack a nil tag, not because it crashes when the app executes setlist:. So the above principle approach will help you find the root of the crash problem.

Don't forget the static analyzer tool, which will catch more bugs. If you are a beginner, you are recommended to open it. You can set up your project on the Build Settings screen:

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.