I have an ivar that is a UIPopoverController. When it gets dismissed, I want to clean up memory. I call the following method when the popover gets dismissed, or if the user pressed the BarButtonItem when the popover is already being presented to the user.
- (void)popoverCleanup:(UIPopoverController *)popoverController {
popoverController.delegate = nil;
popoverController = nil;
}
I set a breakpoint and tried following the code and looking at the memory. I see that my ivar Popover and the method parameter popoverController both point to the same memory address. When I hit the first line, I see the delegate set to nil on both the Popover and popoverController parameter. When I reach the end of the method however, I see only popoverController's memory set to nil, whereas the ivar Popover does not get set to nil. Is there a reason for this?
Thanks.