在我的tableview,我从nibFile加载自定义单元格:UITextFieldDelegate一个customcell
customCell = (cellReponseCircuit *) [tableView dequeueReusableCellWithIdentifier:@"cell"];
if(!customCell)
{
customCell = [[[NSBundle mainBundle] loadNibNamed:@"cellReponse" owner:self options:nil]lastObject];
}
customCell.reponse.text = [[langue singletonLangue] mot:@"Entrer votre réponse ici"];
cell = [customCell retain];
和我的子类的UITableViewCell:
@interface cellReponseCircuit:{UITableViewCell的
IBOutlet UITextField *reponse;
IBOutlet UISegmentedControl *segVraiFaux;
}
@property(nonatomic,retain)IBOutlet UITextField * reponse; @property(nonatomic,retain)IBOutlet UISegmentedControl * segVraiFaux;
@end
但我不往哪里放UiTextFieldDelegate。因为如果我把它放在单元类中,它不起作用,如果我把它放在tableViewController中,它不起作用。
首先,我发现你加载你的细胞**非常**不洁。你在这里使用了很多副作用。你为什么不把那个单元直接放到视图控制器的nib文件中? 其次,我不明白什么在这里不起作用。也许你可以更具体一些... – 2010-08-25 15:24:58
我想使用调用 - (void)textFieldDidBeginEditing:(UITextField *)textField,但是这个方法没有被调用 – alex 2010-08-25 15:29:46