user1467188
user1467188

Reputation: 627

iOS increasing memory usage with two view controllers

I have two ViewControllers.. the first one is a grid of UIButtons, and the second one is a detailed description based on the button they press.

I'm expecting that after they press a UIButton, and then press the back button in the navigation bar, the net change in memory should be zero.

Instead, I'm seeing an increase in memory, and I have no idea why. What happens when a user clicks the back button? How do I completely dismiss the detailed ViewController, completely releasing it from memory? Is there something specific I have to do?

ARC, xcode 4.2.1, iOS 5.0+

Thanks!

EDIT: I used the leaks tool, and there were no leaks discovered. In prepareForSegue, I pass an app object which is an NSDictionary to my new ViewController.

-(IBAction)toApp:(UIButton*)sender {   
[self performSegueWithIdentifier:@"showApp" sender:sender];
}

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(UIButton*)sender {
    AppViewController* vc = [segue destinationViewController];
    vc.app = [self.apps objectAtIndex:sender.tag];
}

Upvotes: 1

Views: 3556

Answers (1)

Rob Napier
Rob Napier

Reputation: 299643

You likely have a retain loop. Use the Allocations tool in Instruments with Heapshot to find it.

Upvotes: 1

Related Questions