我在UITableViewCell中放置了10个UITextField,并在每个UITextField上放置了标签。
我的问题是,我可以在
中访问那些UITextField的标签吗?- (void)textFieldDidBeginEditing:(UITextField *)textField?
答案 0 :(得分:1)
我的问题是,我可以访问那些UITextFields的标签吗?
-(void)textFieldDidBeginEditing:(UITextField *)textField
?
不确定。只需使用:
textField.tag
为特定字段调用方法textFieldDidBeginEditing:
,该字段将在textField
参数中指定。如果要访问不同的字段,则需要获取指向所需字段的指针。你可以这样做:
UIView *parent = [textField superview];
UITextField *someOtherField = [parent viewWithTag:theTagOfTheFieldYouWant];