In controller named controller1, I am pushing a modal view controller
AddConversationViewController *addController = [[AddConversationViewController alloc]
initWithNibName:@"AddConversationViewController" bundle:nil];
//addController.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:addController];
[self presentModalViewController:navigationController animated:YES];
[addController release];
[navigationController release];
and then in that addcontroller, I have allocated several object. but in the dealloc method, when i release those objects, I will get BAD_ACCESS warning when i dismiss the modal view controller. If I don’t release those objects I have allocated, it doesn’t give the BAD_ACCESS warning.
those objects I have allocated before are not released nor retained.
Does anybody know how to fix this memory leak?
I can only guess that when you dismiss the addController, you didn’t deallocate the addController yet but you deallocate its objects.
So, can you try to put deallocate code into dealloc method of the addController