Hi *,
I just asked me how it behaves with the retaincount and presenting a view modal. First some code.
I have the following action in my ViewController:
In the DetailViewController there is another Action to close the DetailView:
So far, everything is working fine. I can load a detailed view for several objects and also leave the detailed view and switch back to my main view.
But what about the retainCount of the(se) DetailViewController(s)? Everytime i call the action i allocate a detailview but by closing the detailview i do not release it.
From the Logic i overwrite my variable "detailViewController" on every call. Do I also reserve memory for every call, or is it also overwritten?
Is this a memory Leak? And if, how can I fix it..
Thanks a lot, Marco
I just asked me how it behaves with the retaincount and presenting a view modal. First some code.
I have the following action in my ViewController:
Code:
-(IBAction)showDetailView:(id)sender{
detailViewController = [[DetailViewController alloc] initWithDetails:(DetailObject *)detailObject];
[self presentModalViewController:detailViewController animated:NO];
}
In the DetailViewController there is another Action to close the DetailView:
Code:
-(IBAction)closeDetailView:(id)sender{
[self dismissModalViewControllerAnimated:YES];
}
So far, everything is working fine. I can load a detailed view for several objects and also leave the detailed view and switch back to my main view.
But what about the retainCount of the(se) DetailViewController(s)? Everytime i call the action i allocate a detailview but by closing the detailview i do not release it.
From the Logic i overwrite my variable "detailViewController" on every call. Do I also reserve memory for every call, or is it also overwritten?
Is this a memory Leak? And if, how can I fix it..
Thanks a lot, Marco