improper warning for "UndetachedDelegate"

Issue #88 new
JinZhuHuang created an issue

When we import a "releaseXXX" helper method, and detach the delegate in this helper method, even since we call this "releaseXXX" in our dealloc, the FauxPas app continued to complaint about the "UndetachedDelegate" warning.

Example code as follow:

- (void)dealloc
 {
     [self releaseChildControllers];
     [super dealloc];
 }

- (void)releaseChildControllers
{
    self.myLeftContoller.delegate = nil;
    self.myLeftContoller = nil;
}

- (void)viewDidLoad
{
    self.myLeftContoller = [[MyLeftViewController alloc] init] autorelease];
     self.myLeftContoller.delegate = self;
    /// some other codes...
}

Comments (4)

  1. Ali Rantakari repo owner

    Thanks for reporting this. This is a known issue — Faux Pas doesn't perform control flow analysis here. If you were to detach the delegate directly in -dealloc the diagnostic should go away.

  2. JinZhuHuang reporter

    since apple has open source the new llvm, will this enhancement supported in ther future?

  3. Log in to comment