macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

tableView:titleForHeaderInSection:

セクションのヘッダタイトルを返します。
-(NSString *)tableView:(UITableView *)tableView
                titleForHeaderInSection:(NSInteger)section

解説

セクションのヘッダタイトルを返します。

返り値

( NSString * )

引数

( UITableView * )tableView
( NSInteger )section

クラス

UITableViewDataSource

Instance Methods

使用可能

iPhone2.0

参照

例文

//セクションのタイトルヘッダ
- (NSString *)tableView:(UITableView *)tv titleForHeaderInSection:(NSInteger)section {
    //セクション
    switch (section) {
        case 0: return @"セクション1";
        case 1: return @"セクション2";
        case 2: return @"セクション3";
    }
	
    return nil;
}