I have created textfields dynamically in UITableView I don't want to pass cursor without entering value in first textfield
[self.playerTable.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx,BOOL*stop)
{
UITableViewCell *cell = obj;
if([cell isKindOfClass:[UITableViewCell class]])
{
for(UITextField *textField in cell.contentView.subviews)
{
if([textField isKindOfClass:[UITextField class]])
{
if ([textField isFirstResponder])
{
[textField resignFirstResponder];
isEditMode = NO;
if(!isEditMode && [playerstr length] > 0)
{
NSMutableArray *playerinfoArry = [dbWrapper getPlayerInfo];
for (Playerinfo *player in playerinfoArry)
{
if ([player.playername isEqualToString:playerstr])
{
isPlayerExist = YES;
isEditMode = !isEditMode;
CustomAlert *alert = [[CustomAlert alloc] initWithTitle:@"" message:@"Please choose a different name" delegate:nil cancelButtonTitle:nil otherButtonTitle:@""];
[_nameField resignFirstResponder];
[alert showInView:self.view];
NSIndexPath *indexPath1=[NSIndexPath indexPathForRow:selectedRow inSection:0];
[_playerTable selectRowAtIndexPath:indexPath1 animated:YES scrollPosition:UITableViewScrollPositionTop];
return;
}
}
}
}
}
}
}
}];