trouble with section headers in UITableView

Posted by richard Stephenson on Stack Overflow See other posts from Stack Overflow or by richard Stephenson
Published on 2010-04-29T13:12:07Z Indexed on 2010/04/29 15:27 UTC
Read the original article Hit count: 198

Filed under:

hi guys , im having a problem with setting my section headers in a uitableview, its probably something really simple i just cant work it out.

instead of displaying different headers for different sections it displays the same header for each section

help me please :)

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    WorldCupAppDelegate *appDelegate = [UIApplication sharedApplication].delegate;

    return [appDelegate.matchFixtures count];
}

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


    WorldCupAppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    Fixtures *fixtures = [appDelegate.matchFixtures objectAtIndex:section];

    return fixtures.matchDate;

}

© Stack Overflow or respective owner

Related posts about iphone-sdk