Tom Lee
Tom Lee

Reputation: 15

iOS Navigation Bar - I would like to set the title in Navigation bar with a dynamic value

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

Answers (1)

Cyrille
Cyrille

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

Related Questions