I have a navigation-based view controller, and in the view controller I hid the top navigation bar and used a custom UIView as the navigation bar.
There is a back button in the UIView panel, and I use the Delegate methods (I announced the protocol) to communicate with the view controller when the back button is saved.
I use a delegate in my panel CustomNavigation id of the delegate;
and in the main view controller, when I select the navigation bar, I set the delegate
topBar = [[TopNavigationBar alloc] initWithFrame:CGRectMake(0, 0, 480, 40)]; topBar.lblTitle.text = @"Shop"; topBar.delegate = self;
I release this panel in the ViewControllers dealloc.
Now, when I click the back button, I use the delegate method to call the popViewController in the main ViewController.
//in Custom Bar -(void)ButtonPressed { [delegate TopNavigationBarBackButtonPressed]; } //In View COntroller -(void)TopNavigationBarBackButtonPressed { [self.navigationController popViewControllerAnimated:YES]; }
The ViewController now opens and the control goes back to the previous viewController, but dealloc does not start in both the ViewController and the UIView
What am I doing wrong?
Bk
source share