Ajouter un bouton en-Tête de section?

J'ai un tableView avec deux section, je veux ajouter un bouton dans la section en-tête(Bouton Action), Il est possible de faire de même dans l'image de l'échantillon?

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {

if(section ==0)
{
    return 0;
}
else{
    UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 300.0, 20.0)];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeContactAdd];
    [button setFrame:CGRectMake(275.0, 5.0, 30.0, 30.0)];
    button.tag = section;
    button.hidden = NO;
    [button setBackgroundColor:[UIColor clearColor]];
    [button addTarget:self action:@selector(insertParameter:) forControlEvents:UIControlEventTouchDown];
    [myView addSubview:button];
    return myView;    }
}

Ajouter un bouton en-Tête de section?

UIView* View = [[UIView alloc] initWithFrame:CGRectMake(10.0, 0.0, 300.0, 44.0)]; // créer l'objet bouton UIButton * headerBtn = [[UIButton alloc] initWithFrame:CGRectZero]; headerBtn.backgroundColor = [UIColor clearColor]; headerBtn.opaque = NON; headerBtn.frame = CGRectMake(10.0, 0.0, 100.0, 30.0); [headerBtn setTitle:@"" forState:UIControlEventTouchUpInside]; [headerBtn addTarget:auto action:@selector(ActionEventForButton:) forControlEvents:UIControlEventTouchUpInside]; [Vue addSubview:headerBtn]; return;
Si vous avez essayé que dans viewForHeaderInSection alors quel est le problème?
pls vérifier mon code
est-il ne pas montrer le bouton?
oui ne pas montrer

OriginalL'auteur Rey_mysterio | 2013-03-15