Xcode Development Debugging Tips-.static Analyzer

Source: Internet
Author: User

1.Static Analyzer (static analysis)
Static Analyzer is a very good tool that can help us discover issues that compiler warnings do not prompt.
Static Analysis Benefits:
1, easy to use operation.
2, can be in the coding phase, the development of self-code inspection. Early detection of code pitfalls.
3, directly analyze the source code to find errors in the program, without the need to actually run.
4. Automatic detection of bugs in objective-c programs, memory leaks and other problems.
5. The sooner the memory problem is discovered, the smaller the cost of the solution.

The Static analysis can be used to analyze some of the following:
1 Correct use of retain and release
2 Unused instance variables
3 Uninitialized variables
4 except 0
5 Type not compatible
6 Unreachable code path
7 referencing a null pointer
8 Missing Dealloc

Static Analysis Usage:
1. Open the Xcide "Product" menu and select the Analyzer option (or use the hotkey Command + Shift +b). 2.Static Analyzer captures possible problems in any application and then displays them with a blue warning. 3. We can also set up our app to automatically turn on Static Analyzer when we compile the application, open the project projects file, and set "Run Static Analyzer" to Yes, such as:

Recommended Use scenarios:
1, it is recommended to use in the development of the coding phase, direct analysis of the source code to find errors in the program, without the need to actually run, early detection of hidden code.
2, test in the smoke test can be scanned first, error too much code modification too large cases can be temporarily not involved in testing, so as not to cause rework.

Xcode Development Debugging Tips-.static Analyzer

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.