hilaj hilaj - 1 year ago 57
iOS Question

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..

Answer Source
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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download