How to set the UITableView Section title programmatically (iPhone/iPad)?

前端 未结 8 2106
太阳男子
太阳男子 2020-12-07 10:54

I\'ve created a UITableView in Interface Builder using storyboards. The UITableView is setup with static cells and a numb

8条回答
  •  日久生厌
    2020-12-07 11:33

    titleForHeaderInSection is a delegate method of UITableView so to apply header text of section write as follows,

    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
                  return @"Hello World";
    }
    

提交回复
热议问题