#import "TableViewCell.h"
@interface ViewController ()<UITableViewDelegate , UITableViewDataSource>
@property (nonatomic , strong) UITableView *tableView;
@end
@implementation ViewController
- (void)viewDidLoad {
? ? [super viewDidLoad];
? ? _tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
? ? _tableView.dataSource = self;
? ? _tableView.delegate = self;
? ? [self.viewaddSubview:self.tableView];
? ? [_tableView registerNib:[UINib nibWithNibName:@"TableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"cell"];
}
-(NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section{
? ? return 2;
}
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{
? ? staticNSString*string =@"cell";
? ? UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:string];
? ? if(!cell) {
? ? ? ? cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:string];
? ? }
? ? return cell;
}