1
我有一个动态tableView
。几个单元格有一个textField
。UITableView在textFieldDidBeginEditing中获取indexPath:
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(15,10,260,40)];
textField.delegate = self;
[cell addSubview:textField];
我试图让textFieldDidBeginEditing
的indexPath
。这里是我的代码
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
CGPoint location = [self.view.superview convertPoint:self.view.center toView:self.orderTableView];
NSIndexPath *indexPath = [self.orderTableView indexPathForRowAtPoint:location];
NSLog (@"IndexPath %@", indexPath);
NSLog (@"IndexPath.ROW %i", indexPath.row);
}
我有第一个4个单元格(索引0 - 3)是标准单元格。在前4个单元之后,我可以动态地使用UITextField将多达3个自定义单元。
的UIViewController中后,会出现与UITableView的,而不管是什么TableViewCell用的UITextField我点击的的NSLog下面不断显示我下面的:
2013-07-09 07:21:40.910 MyApp[2884:c07] IndexPath <NSIndexPath 0xa0a5d60> 2 indexes [0, 3]
2013-07-09 07:21:40.910 Mypp[2884:c07] IndexPath.ROW 3
我如何才能让细胞与正确indexPath
UITextField
那叫做键盘?
cool :) ..正确答案 –