i want title @ top of page in navigation bar change based on text entered specific text field. through separate uinavigationcontroller or in uiviewcontroller, , if how work?
you don't need separate uinavigationcontroller; can set title with
self.navigationitem.title = titletextfield.text; if set view controller delegate of uitextfield, , implement method:
- (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string { if (textfield == titletextfield) { self.navigationitem.title = [textfield.text stringbyreplacingcharactersinrange:range withstring:string]; } return yes; } you'll title updates in real time. (remember method called before textfield.text changes, that's why there stringbyreplacingcharactersinrange:withstring: call in it.)
Comments
Post a Comment