次のように、ビューコントローラー内に UITableView コントローラーをセットアップしました。
fieldView = [[UITableView alloc] initWithFrame:CGRectMake(0, logoView.bounds.size.height, 320, (screen.size.height - logoView.bounds.size.height)) style:UITableViewStylePlain];
[fieldView setBackgroundColor:[UIColor greenColor]];
fieldView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleTopMargin;
View Controller は、次のように TableViewDelegate になるように設定されています。
UIViewController <UITableViewDelegate, UITableViewDataSource...
質問: この追加されたサブ ビューを制御するために、テーブル ビュー デリゲート メソッドに対して何をする必要がありますか?
#pragma mark -
#pragma Table View Delegate Methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
NSLog(@"Here");
return 1;
}
- (NSString *)tableView:(UITableView *)fieldView titleForHeaderInSection:(NSInteger)section {
NSString *sectionName;
NSLog(@"Here2");
上記のメソッドはView Controllerにありますが、呼び出されていませんか?