Hi everyone,
I have RootViewController and DetailsViewController in my iPhone application. I use Allocations tool to monitor my memory consumption, and I have a question.
When my app starts it takes around 4Mb memory, when I select item in RootViewController it loads UIWebView in DetailsViewController and memory rise up to 10Mb, after I return to RootViewController memory stays at 10Mb level and DetailsViewController has retainCount = 2
(even though I create it only once).
How should I free this memory? I know that I should do it if my apps receive memory warning, but I'm creating this ViewController using initWithNibName:
, so I understand that I should not send release
to it.
Thanks.
Edit
I load it like this:
if (self.detailsViewController == nil)
{
detailsViewController *d = [[detailsViewController alloc]
initWithNibName:@"DetailsViewController"
bundle:[NSBundle mainBundle]];
self.detailsViewController = d;
[d release];
self.detailsViewController.urlToLoad = urlToLoad;
}
[self.navigationController pushViewController: self.detailsViewController animated:YES];