I have a problem in the iOS application, which after some time is not canceled, as it should be. I suspect that this is because there is still a link to it. I am using ARC.
I want to find out where this link is created. Then I can tell where it should be NULLED or if it should be weak.
What I present as a possible solution:
If I could set a breakpoint for every place where the link count, so how to keep the count changed, then I will quickly find the problem. I just don't know how to set such a breakpoint. Perhaps in pre-ARC times this could be done by setting breakpoints inside retainand release, but I have no idea how to do this with ARC.
A very simplified code example:
I did this in one of my classes, and I know where:
- (void) dealloc {
NSLog(@"%s", __FUNCTION__);
}
And I suspect that some time ago I wrote code like this, but I cannot find where it was:
@interface UnknownSuspect ()
@property (strong, readwrite) id referenceWhichIsNeverNeeded;
@end
- (void) someMethod:(ShouldBeDeallocated*)ref {
self.referenceWhichIsNeverNeeded = ref;
}
source
share