I have a UITextField
inside my UITableViewCell
knowing that my UITableView
contains 3 rows, and I'm differentiating each UITextField
putting a new tag like this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
...
cell.myTextField.tag = indexPath.row;
...
}
It is known also that there is a function called 'getByTag', which is so called must catch the existing text in the UITextField whose tag equals 2, so I tried this:
-(void)getByTag{
NSLog(@"Text is -> %@",cell.myTextField.tag[2].text);
}
The code myTextField.tag[2]
did not work as I expected because I believe this means selecting not work very well and give me a compiler error. Could someone give me some help on how I can get around this error compilation and make my program select the existing text in my UITextField whose tag is equal to 2?