Memory leakage and excessive release Detection

Source: Internet
Author: User

If an exc_bad_access error occurs, it is basically caused by a memory leak and an error is released. The release operation is performed on a released object. However, xcode sometimes does not tell you where the error is (Visual Studio is doing well ). However, you can set the xcode environment variable nszombieenabled and mallocstacklogging to view the error source:

To set the xcode environment variable nszombieenabled and mallocstacklogging, take xcode4.5 as an example:

1. Click the product menu of xcode and select the edit scheme... option.

2. Select Run... on the left and click arguments on the right.

3. In the environment variables column, add nszombieenabled and set value to yes. Then add mallocstacklogging and set value to yes;

As shown in:

The above options are only valid on the simulator. If you change the IOS version, you need to reset it.

After debugging, remember to remove the environment variable nszombieenabled and mallocstacklogging because they will prevent memory from being released.


Memory leakage and excessive release Detection

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.