У меня есть серия текстовых полей в ячейках UITableView
. Я успешно выполнил сборку таблицы. Но так или иначе делегат текстового поля, например -(void)textFieldDidBeginEditing
, не получает вызова. Я разместил код ниже.UITextfield делегат не запускается
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *myCell;
if ([indexPath section]==1 && arrBlockFriendsName.count>0)
{
static NSString *[email protected]"BlockCell";
BlockUsersTableViewCell *cell=(BlockUsersTableViewCell*)[tableView dequeueReusableCellWithIdentifier:identifier];
if (cell==nil)
{
cell=[[[NSBundle mainBundle]loadNibNamed:@"BlockUsersTableViewCell" owner:self options:nil]objectAtIndex:0];
}
cell.imgBlockFriend.image=[UIImage imageNamed:[arrBlockFriendsImage objectAtIndex:indexPath.row]];
cell.imgBlockIcon.image=[UIImage imageNamed:@"user_lock_icon1.png"];
cell.lblBlockFriendName.text=[arrBlockFriendsName objectAtIndex:indexPath.row];
cell.lblBlockFriendPlace.text=[arrBlockFriendsPlace objectAtIndex:indexPath.row];
myCell=cell;
}
if ([indexPath section]==3)
{
AgeSliderTableCell *cell=(AgeSliderTableCell*)[tableView dequeueReusableCellWithIdentifier:@"AgeCell"];
//cell.delegate=self;
if (cell==nil)
{
cell=[[[NSBundle mainBundle]loadNibNamed:@"AgeSliderTableCell" owner:self options:nil]objectAtIndex:0];
}
[cell.labelSlider setUpperValue:ageUpperValue];
[cell.labelSlider setMinimumValue:18];
[cell.labelSlider addTarget:self action:@selector(updateSliderLabels:) forControlEvents:UIControlEventValueChanged];
myCell=cell;
}
if ([indexPath section]==4 && arrLocationLabel.count>0)
{
static NSString *[email protected]"LocationCell";
LocationTableViewCell *cell=nil;
if (indexPath.row ==3)
{
cell=[tableView dequeueReusableCellWithIdentifier:identifierLocation];
cell=[[[NSBundle mainBundle]loadNibNamed:@"LocationTableViewCell" owner:self options:nil]objectAtIndex:1];
[cell.btnSave addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
}
if(indexPath.row==0 || indexPath.row==1 || indexPath.row==2)
{
cell=[tableView dequeueReusableCellWithIdentifier:identifierLocation];
cell=[[[NSBundle mainBundle]loadNibNamed:@"LocationTableViewCell" owner:self options:nil]objectAtIndex:0];
cell.lblLocationDetails.text=[arrLocationLabel objectAtIndex:indexPath.row];
cell.txtLocationDetails.delegate=self;
}
myCell=cell;
}
myCell.selectionStyle=UITableViewCellSelectionStyleNone;
return myCell;
}
Любые идеи, которые могут отсутствовать?
сделал и установил делегат для текстового поля .... как 'txtfield.delegate = self' –