Reputation: 184
Above Function is not Getting called when i select the cell inside UITableView which i have inserted inside the footerView of another UITableView
I have added the UITableView inside the below function and I able to see all the items which i have inserted
But I am not able to click on Cells.
I Have Also inserted Some UIButton to check if the click is working ,which working fine
thanks in advance.
- (UIView *)tableView:(UITableView * )tableView viewForFooterInSection:(NSInteger)section {
if(tableView==_ordersListTable)
{
//creating view to pass to footerview
UIView *footerView;
footerView.userInteractionEnabled=true;
if(footerView == nil) {
//allocate the view if it doesn't exist yet
footerView = [[UIView alloc] init];
}
//initializing table
_paymentInfoTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 40, 320, 80)];
_paymentInfoTable.backgroundColor = [UIColor whiteColor];
_paymentInfoTable.delegate = self;
_paymentInfoTable.dataSource = self;
//_paymentInfoTable.separatorStyle = UITableViewCellSeparatorStyleNone;
_paymentInfoTable.separatorInset = UIEdgeInsetsMake(0, 110, 0, 180);
[footerView addSubview:_paymentInfoTable];
}
//return the view for the footer
return footerView;
} else
{
return 0;
}
}
Upvotes: 0
Views: 300
Reputation: 252
Since you have two UITableViews to control, the delegates of both the UITableViews have to be set correctly. Did you set these delegates?
By checking the UITableView in the delegate methods, you can control both UITableViews:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView == self.tableView1) {
// Do your thing with the first UITableView
}
else {
// Do your thing with the other UITableView
}
}
Upvotes: 3