I am working on the table view and do customization for tableFooterView.What I am doing is :
ClassA.m
- (void)viewDidLoad
{
FooterViewController *footerView = [[FooterViewController alloc] initWithNibName:@"FooterViewController" bundle:nil];
// Add selector of Class A to checkOutButton
[footerView.checkOutButton addTarget:self action:@selector(goToCheckOut) forControlEvents:UIControlStateNormal];
self.shoppingListTable.tableFooterView.backgroundColor = [UIColor clearColor];
self.shoppingListTable.tableFooterView = footerView.view;
}
- (void)goToCheckOut {
NSLog(@"this is a response from a button");
}
FootViewController.h
@interface FooterViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *amount;
@property (strong, nonatomic) IBOutlet UIButton *checkOutButton;
@end
The outlet are also connected to the xib files as well
However, when I click on the button, it does not respond at all and the log shows nothing….
What I am doing wrong at here. Please help if you have any ideas about this. Thanks
Try this: