How To Set Group Table's Section Header Text

I want to set header text for each section of my grouped UITableView.

I tried this code but get error "EXC_BAD_ACCESS"

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    if (tableView.tag==2)
    {
        if (section == 0)
        {
              return @"test1";
        }
        if (section == 1)
        {
              return @"test2";
        }
    }
}
6
задан 22 April 2011 в 06:40
поделиться