Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i get the textfield value from tag in iPhone sdk?

if i have a tag of text field then how can i pick the value of textfield in iPhone sdk

like image 847
Jaspreet Singh Avatar asked Aug 02 '12 11:08

Jaspreet Singh


2 Answers

you should be fine with something like (assuming that the TextField is a self.view's subview):

NSString *text = [(UITextField *)[self.view viewWithTag:THE_TAG] text];
like image 132
Bruno Koga Avatar answered Sep 19 '22 18:09

Bruno Koga


NSString *text = [(UITextField *)[self.view viewWithTag:tag] text];

like image 23
ravinder521986 Avatar answered Sep 21 '22 18:09

ravinder521986