index rss mastodon twitter github linkedin email
Álvaro Ramírez
sponsor

Álvaro Ramírez

15 June 2015 Debugging Objective-C reference cycles

Overriding retain/release/autorelease may be handy while debugging:

- (instancetype)retain {
  NSLog(@"%p, retain\n", self);
  return [super retain];
}

- (oneway void)release {
  NSLog(@"%p, release\n", self);
  [super release];
}

- (instancetype)autorelease {
  NSLog(@"%p, autorelease\n", self);
  return [super autorelease];
}