2012-04-21 2 views
1

私のtableView didSelectRowAtIndexPathでは、セルtextLabelにアクセスできます。セクションラベルにはどのようにアクセスすればよいですか?didSelectRowAtIndexPathからUITableViewセクションラベルにアクセスする方法

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    topPlacesAppDelegate *appDelegate = (topPlacesAppDelegate *) [[UIApplication sharedApplication] delegate]; 
    appDelegate.chosenPhoto = [self.topPlaces objectAtIndex:indexPath.row]; 
. . . 
    UITableViewCell *mycell = [tableView cellForRowAtIndexPath:indexPath]; 
    NSLog(@" indexPath.section/Row = %i/%i", indexPath.section, indexPath.row); 
    NSLog(@" textLabel.text   = %@", mycell.textLabel.text); 
    NSLog(@" detailTextLabel.text = %@", mycell.detailTextLabel.text); 

    [self performSegueWithIdentifier:@"Show Site Table" sender:nil]; 
} 

答えて

0

テーブルセクションヘッダーを探しているようです。私はあなたがそのデータを読んだり、そうでなければアクセスできるとは思わない。

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 

詳細はここで説明されています:

Change UITableView section header/footer WHILE RUNNING the app?

しかし、あなたは UITableViewDataSourceの方法でそれをを設定することができます
関連する問題