Ios tableview没有';在节方法中看不到标题

Ios tableview没有';在节方法中看不到标题,ios,uitableview,Ios,Uitableview,我试图为我的tableview.tableview本身创建一个自定义viewForHeaderInSection 工作正常,但由于某种原因,编译器会跳过 -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{} 委托方法,我尝试了写在引用上的内容,还有这个。但由于某些原因,它无法读取这些方法。显然,我做错了什么。如果有人能指出我的错误,我将不胜感激。先谢谢你

我试图为我的
tableview.tableview
本身创建一个自定义
viewForHeaderInSection
工作正常,但由于某种原因,编译器会跳过

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{}    
委托方法,我尝试了写在引用上的内容,还有这个。但由于某些原因,它无法读取这些方法。显然,我做错了什么。如果有人能指出我的错误,我将不胜感激。先谢谢你

#import "TableViewController.h"

@interface TableViewController ()

@end

@implementation TableViewController
@synthesize settingTableView,audioPlayer,labelSwitch,descriptiveSwitch,autoPlaySwitch;;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.settingTableView.tableFooterView = [[UIView alloc]init];
    self.settingTableView.scrollEnabled = NO;

    settings = @{@"Animation Sets" : @[@"Set1",@"Set2",@"Set3"],@"Settings" : @[@"Label",@"Sound",@"Autoplay"]};
    values = [[settings allKeys]sortedArrayUsingSelector:@selector(localizedStandardCompare:)];

    [settingTableView setRowHeight:44];
    [settingTableView reloadData];

}

-(void)close:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
    [self.delegate closeView];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return [values count];
}
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {

    return [values objectAtIndex:section];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    NSString *sectionTitle = [values objectAtIndex:section];
    NSArray *sectionValue = [settings objectForKey:sectionTitle];
    return [sectionValue count];
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    CGRect frame = tableView.frame;
    NSString *value = [values objectAtIndex:section];

    UILabel *title = [[UILabel alloc]init];
    UIView *headerView = [[UIView alloc]init];

    //if (section == 0 && section == 1) {

    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
        title.frame = CGRectMake(10,10,150,30);
    }
    else
    {
        title.frame = CGRectMake(10,5,100,30);
    }

    title.backgroundColor = [UIColor clearColor];
    title.text = value;

    headerView.frame = CGRectMake(0,0,frame.size.width,frame.size.height);
    headerView.backgroundColor = [UIColor clearColor];
    [headerView addSubview:title];
        [headerView setBackgroundColor:[UIColor blueColor]];
    //}
    return headerView;
    [settingTableView reloadData];
    }

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell* cell = nil;

    static NSString *MyCellIdentifier = @"Cell";

    cell = [tableView dequeueReusableCellWithIdentifier:nil];

    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                      reuseIdentifier:MyCellIdentifier];

        cell.textLabel.numberOfLines = 2;
        cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:17.0];

        NSString *sectionTitle = [values objectAtIndex:indexPath.section];
        NSArray *sectionValue= [settings objectForKey:sectionTitle];
        NSString *settingValues = [sectionValue objectAtIndex:indexPath.row];

        cell.textLabel.text = settingValues;
        return cell;
    }
}

您需要确保实现该委托方法的类是表视图的
delegate
dataSource

添加代码以查找错误所在。我已添加了上述代码。请选中删除此行“[settingTableView reloadData];”在viewforheaderinsectionremoved中,问题仍然没有解决。请帮助您滚动表格视图好吗?是的,我已经在.h文件中实现了委托和数据源方法,并且还面临上述问题。单元格的内容和所有内容都正常工作?
titleForHeaderInSection
中有什么内容?行工作正常的单元格只有titleForHeaderInSection方法在编译时不调用-(NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section{return[values objectAtIndex:section];}是的,里面有什么?你能把方法的内容放在那里吗?(NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section{return[values objectAtIndex:section];}