In my viewDidLoad, I have written this code:
UIView *footerView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(10,10, 300, 40);
[btn setTitle:@"Select" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(onClickSelect:) forControlEvents:UIControlEventTouchUpInside];
[footerView addSubview:btn];
myTableView.tableFooterView = footerView;
and My selector method is:
- (void) onClickSelect: (UIButton*) sender
{
NSLog(@"selext");
}
but when I click the button (which I have added in the table footer view), the selector method doesn’t get called. Does anyone know what might be the problem?
Set the correct frame for FooterView.Something like