I want to navigate to the particular page in my application and i also dont want to create any custom back button for that.If I can override the method of the navigation bar back button so I can call the poptorootviewcontroller.so i can go to specific page. Anyone knows what is the method that is called by the navigation bar button and if we can use it?
You can try this.. Write your logic in this native method.
-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:YES];
// Your Code
}
You will have to provide the name and the implementation for the button method As there is no standard method ..
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed)] autorelease];
implementation ..
-(void) backButtonPressed {
NSLog(@"Back button presses");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With