In ARC on iOS 5, can you see who caused the release?

In my iOS 5 project with ARC enabled, one of my objects gets released prematurely, so when I try to get to it, I get a null pointer. Before ARC, I would simply override release as follows:

 -(oneway void)release { NSLog(@"-1"); //breakpoint goes here [super release]; } 

then added a breakpoint to NSLog and checked the call stack to see who triggers the release.

How do you know who named an ARC release? ("Called" may be the wrong word because the compiler inserts release calls, so I mean "where is the line where the compiler inserted the release call?").

+4
source share
1 answer

If you need to see where they are stored, released, and autorealized for tools using the object:

Run in the tools, in Allocations set the value to "Record reference counts" (you must stop recording to set the parameter). Because of the problematic code to start, stop recording, search for ivar of interest, detail, and you will be able to see where everything is saved, releases and auto-implementers.

enter image description here

+8
source

Source: https://habr.com/ru/post/1395780/


All Articles