I have a main View that some events happen and you can click in some buttons in this view and go to another one. In that view I have a navigation item that displays a Back button. For example: Main View title = "News". When I open a new view that back button is "News". Now, I would to change that back button title to "News (8)".
I already tried this code to set the backButtonItem in the second view:
self.navigationItem.backBarButtonItem.title = @"News (1)";
but I realized that you have to set the first (main view) back button title, so I tried in the first View:
self.navigationItem.backBarButtonItem.title = @"News (1)";
it works BUT only when I click on the back button. It changes the title and make the action to back to the main view. Is there any way to "update" the back button title before click on it?
https://i.stack.imgur.com/xAHuI.png
https://i.stack.imgur.com/20mnt.png