在我的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