我正在处理表格视图并进行自定义。tableFooterView
我正在做的是:
类A.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
插座也连接到 xib 文件
但是,当我单击按钮时,它根本没有响应,并且日志什么也没有显示......
我在这里做错了什么。如果您对此有任何想法,请提供帮助。谢谢