Your TextView will be contained in some cell. When you find this cell, you can query the table for the index. Scroll up the view hierarchy from the TextView to find the cell. For instance:
TextView* textView = // your textView; UITableViewCell* cell = (UITableViewCell*)[textView superview]; UITableView* table = (UITableView *)[cell superview]; NSIndexPath* pathOfTheCell = [table indexPathForCell:cell]; NSInteger rowOfTheCell = [pathOfTheCell row]; NSLog(@"rowofthecell %d", rowOfTheCell);
source share