标签:
考虑到代理方法 :textFieldDidEndEditing不能监听到textFiled实时的改变,想要实现实时监听 建议注册通知去监听textField的实时改变,直接上代码:
[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(infoAction)name:UITextFieldTextDidChangeNotificationobject:nil];
- (void)infoAction
{
NSIndexPath *index = [NSIndexPathindexPathForRow:0inSection:1];
OrderConfirmInfoTableViewCell *cell = (OrderConfirmInfoTableViewCell *)[_tableViewcellForRowAtIndexPath:index];
_phoneStr = cell.phoneField.text;
_addrStr = cell.addressField.text;
}
infoAction里就可以把监听的textfield的值的改变 实时的赋值给另一个对象。
标签:
原文地址:http://blog.csdn.net/liuxu0718/article/details/44480775