Xcode : textfield redirects to nib
I have an app that explains terms. They are all explained in nib files. For example, the word "car". The user has to search for the word "car".
I want to have a text field. In that text field the user can type the word "car" and it will go to the nib file : "car". How do 开发者_开发问答I do that?
It's like app where you can type an question in a text field and it will answer you in a nib file if you write the question correctly.
1) declare a new IBAction called lookForTerm: in an objrct (eg appDelegate) 2) in the .m file add this method:
-(IBAction)lookForTerm:(id)sender { UiTextField* field = sender; if ([[field text] isEqualToString:@"car"]) { Load your nib } }
3) connect in the interface builder the action with your textfield
精彩评论