Dodaj przyciski pod widokiem tabeli

Próbuję utworzyć widok programowo. Rezultatem, który chcę mieć, jest widok przewijania z widokiem tabeli wewnątrz. W tym widoku tabeli chcę dodać kilka przycisków

Nie wiem dokładnie, jak to zrobić, próbowałem tego, ale to nie działa:

- (void)loadView {
    [super loadView];

    tableView = [[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped];
    [tableView setDelegate:self];
    [tableView setDataSource:self];

    scrollView = [[UIScrollView alloc] initWithFrame:[[self view] bounds]];
    //[scrollView setBackgroundColor:[UIColor blackColor]];
    [scrollView setBouncesZoom:YES];

    deconnectButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
    [deconnectButton setTitle:@"Deconect" forState:UIControlStateNormal];
    [deconnectButton setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];

    //[deconnectButton addTarget:self action:action forControlEvents:UIControlEventTouchUpInside]; 
    deconnectButton.frame = tableView.frame;
    NSLog(@"Tableview frame : %@", NSStringFromCGRect(tableView.frame));

    [scrollView addSubview:deconnectButton];

    [scrollView addSubview:tableView];


    [[self view] addSubview:scrollView];


}

Czego mi brakuje lub co robię źle?

questionAnswers(3)

yourAnswerToTheQuestion