Reputation: 478
I use faux pas to check my code, and it says
When an object sets itself as the delegate or data source of one of its members, it must detach that reference in its -[NSObject dealloc] method.
So I need to write
- (void)dealloc
{
self.tipsView.delegate = nil;
}
Why? If the delegate is weak, I cannot find the necessity to set it nil when it deallocs.
Upvotes: 1
Views: 132
Reputation: 1867
In case your delegate is weak reference you are right, setting it to nil makes no sense. The tool is wrong.
Upvotes: 1
Reputation: 4522
The only reason to do that is if you are not using ARC. I think the tool is either old or not configured to know that you are using ARC.
Upvotes: 1