0

I am having memory leaks when I m using a view controller's view My code sequence is like this

 viewController1 = [[ViewController alloc] init];
   destinationViewController = [[DestinationViewController alloc] init];
   [destinationViewCOntroller useView:viewController1.view];
   [viewController1 release];
   [destinationViewController release];

And for testing purpose I have empty implementation in useView method. So my problem is viewController1 is never getting deallocated. I have made sure that no other place has any reference to viewController1. When I remove the method call(useView) where I pass viewcontroller1.view then viewcontroller1 is deallocating properly. Any ideas why the behaviour is like this?

sridevi
  • 617
  • 1
  • 6
  • 15

1 Answers1

0

This seems to be a rather academic problem. Just enable ARC and forget about it.

Mundi
  • 79,884
  • 17
  • 117
  • 140