ЕСЛИ ВЫ ИСПОЛЬЗУЕТЕ XIB
Вам необходимо создать файл tablviewcell и создать собственную ячейку.
Импортировать файл ячейки тоже.
import "selectedcell.h"
{[super viewDidLoad];
array =[[NSArray alloc]initWithObjects:@"AAAA",@"BBBB",,@"CCCC", nil];
tableView = [[UITableView alloc] initWithFrame:self.view.bounds
style:UITableViewStylePlain];
tableView.delegate = self;
tableView.dataSource = self;
[self.tablview registerNib:[UINib nibWithNibName:@"SelectedTableViewCell"
bundle:nil] forCellReuseIdentifier:@"cellidentifier"];
self.tablview.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero];
[self.view addSubview:tableView];
}
(NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection: (NSInteger) section {return array.count;}
(UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {
SelectedTableViewCell * cell = [tableView dequeueReusableCellWidenIIIDforIndexPath: indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleGray;cell.label.text = [Nsstring stringwithformate: @ "% @", [array objectatindex: indexpath.row]];
return cell;}
(void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {// После выбора строки}
- (CGFloat) tableView: (UITableView *) tableView heightForRowAtIndexPath: (NSIndexPath *) indexPath {return 50;}