我是通过 storyboard 创建的tableview ,只需要outlet下 然后给 tableview的tablefooterview设置一个uivew就行了 ,上代码
@interface MainViewController ()
@property NSArray *receps;
@property (strong, nonatomic) IBOutlet UITableView *mainTableView;
@end
@implementation MainViewController
<img src="https://img-blog.csdn.net/20150908165447173?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
- (void)viewDidLoad {
[super viewDidLoad];
_receps = [NSArray arrayWithObjects: @"one",@"two",@"three",@"four",@"five",@"six",@"seven",@"eight",@"nine",@"ten",nil];
<span style="color:#FF0000;">_mainTableView.tableFooterView = [[UIView alloc] init];</span>
}