Creating a UITableViewController programmatically

前端 未结 4 751
逝去的感伤
逝去的感伤 2020-12-30 17:44

This is what I tried. Nothing appears on the screen and none of the UITableView methods that you are supposed to implement are getting called.

-(void)loadVie         


        
4条回答
  •  有刺的猬
    2020-12-30 18:33

    iOS7 seems to like this way of init'ing the tableview:

    //make tableview
    UITableView *table = [[UITableView alloc] initWithFrame:CGRectMake(0, 81, 200, 200) style:UITableViewStylePlain];
    table.dataSource = self;
    table.delegate = self;
    [self.dataView addSubview:table];
    

    try that out. Hope it helps someone.

提交回复
热议问题