To be clear, I still want the back button to return to the original view, but at the same time change the value of the integer. Thank you!
Add UINavigationBarDelegate in the header file and add it in the .m Use it in the file:
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
{
/ /insert your back button handling logic here
// let the pop happen
return YES;
}
I have a table view , Push to the detail view controller. From the detail view controller, when I press the “back” button, I want an integer value to change. How to programmatically edit the operation of the navigation bar back button. The back button will automatically be put In my application, because I’m using a table view, I don’t actually create a button, so I don’t know how to influence it.
To be clear, I still want to go back The button returns to the original view, but at the same time changes the value of the integer. Thank you!
Thanks to PengOne for pointing me in the direction.
Add UINavigationBarDelegate in the header file and use it in the .m file:
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
{
//insert your back button handling logic here
// let the pop happen
return YES;
}