Closed steve21124 closed 12 years ago
It's very simple here is a simple example:
UITableView *myTableView = [[UITableView alloc] initWithFrame:CGRectZero];
BKTableModel *model = [BKTableModel tableModelForTableView:myTableView];
Just provide your tableview instance when you instantiate your tablemodel
It give error "CellMappingExample[16650:207] -[BKTableModel superview]: unrecognized selector sent to instance 0x6a2caf0"
// self.tableView= [[UITableView alloc] initWithFrame:CGRectZero]; self.tableView= [[UITableView alloc] initWithFrame:self.view.bounds]; // self.tableView = [BKTableModel tableModelForTableView:self.tableView delegate:self]; [self.view addSubview:self.tableView];
----------- This below create UITableView fine @interface TableViewControllerExample : UIViewController<BKTableModelDataSource,UITableViewDataSource,UITableViewDelegate>{
}
(void)viewDidLoad { // self.tableView= [[UITableView alloc] initWithFrame:CGRectZero];
self.tableView= [[UITableView alloc] initWithFrame:self.view.bounds];
// self.tableView = [BKTableModel tableModelForTableView:self.tableView delegate:self];
[self.view addSubview:self.tableView]; }
You must not do that, BKTableModel don't hinerit from UITableView self.tableView = [BKTableModel tableModelForTableView:self.tableView delegate:self];
Instead do some like self.tableModel = [BKTableModel tableModelForTableView:self.tableView delegate:self]; were tableModel is a property of type BKTableModel
thanks
Currently, BKTableModel use UITableViewController instead of UIViewController. I create table automatically using UITableView.