Reputation: 15
iOS Navigation Bar - I would like to set the title in Navigation bar with a dynamic value.
Title could be Coffee (xxx cups)
The value of xxx is changed dynamically based on user input.
Thank you.
Upvotes: 0
Views: 102
Reputation: 25144
Somewhere in your view controller code:
self.navigationItem.title = [NSString stringWithFormat:@"Coffee (%d cups)", self.numberOfCupsOfCoffee];
Without more details, I can't be more precise.
Upvotes: 3