Hilaj S L
Hilaj S L

Reputation: 2046

How to distinguish two UITableView having a same custom cell

Hi I have two UITableView in a UIView class and are loaded with same custom UITableViewCell. Custom tableview cell contains a UITextField. That means the two UITableView contains a UITextfield of same custom cell. When I select any of that textfield, how do I know which tableView's textfield is selected? Please help me..

Upvotes: 2

Views: 71

Answers (1)

Nitish
Nitish

Reputation: 14123

UITextField *txt = ----;

txt.superView.superview will give you the required UITableView instance.
To be more clear :

UITableViewCell *cell = txt.superView;   // In your case custom cell
UITableView *yourTable = cell.superView;

Upvotes: 1

Related Questions