ARC-Xcode detection cycle reference, and arc-xcode detection reference

Source: Internet
Author: User

ARC-Xcode detection cycle reference, and arc-xcode detection reference

1. Create a project on the desktop and enter the following code in ViewController. m:

 

- (void)viewDidLoad {    [super viewDidLoad];    // Do any additional setup after loading the view, typically from a nib.            NSMutableArray *firstArray=[[NSMutableArray alloc]init];    NSMutableArray *secondArray=[[NSMutableArray alloc]init];    [firstArray addObject:secondArray];    [secondArray addObject:firstArray];    }

 

After the code is added, the project file is shown in:

 

 

 

2. Select the Product -----> Profile -------> Project simulator to start running, as shown in:

 

 

 

3. In the pop-up dialog box, select Leaks ----> Choose.

 

 

 

4. After Choose is selected, the following page is displayed. Allocations is selected by default.

 

 

5. Select Leaks.

 

 

 

6. Select the Red Circle in the upper left corner. The red circle turns into a square shape. At this point, start running the project and check for circular references.

 

 

 

7. The following interface is displayed.

 

 

 

 

8. Click the black circle and the circle turns red again. The cyclic reference detection is stopped temporarily.

 

 

 

9. loop detection is completed. A red line appears in Leaks, indicating a memory leak.

 

References: iOS development advanced-Tang Qiao

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.