Skip to content

Instantly share code, notes, and snippets.

@mattjgalloway
Created September 28, 2012 22:27
Show Gist options
  • Save mattjgalloway/3802388 to your computer and use it in GitHub Desktop.
Save mattjgalloway/3802388 to your computer and use it in GitHub Desktop.
Leaks detection not working for UIViewController subclass
@interface SubclassNSObject : NSObject
@property (nonatomic, strong) SubclassNSObject *other;
@end
@implementation SubclassNSObject
@end
@interface SubclassUIViewController : UIViewController
@property (nonatomic, strong) SubclassUIViewController *other;
@end
@implementation SubclassUIViewController
@end
{
SubclassNSObject *a = [SubclassNSObject new]; ///< Leak detected
a.other = a;
SubclassUIViewController *b = [SubclassUIViewController new]; ///< Leak **NOT** detected
b.other = b;
}
@mattjgalloway
Copy link
Author

I have no idea why the SubclassNSObject shows as a leak but SubclassUIViewController does not :-(. Sniffs of a bug to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment