I'm having trouble changing the section header for my grouped uitableview. I have tried everything. I have wondered whether it is a bug with the simulator or something? I am running the latest version of xcode and am developing for the iPad.
Here's my tableview header code
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UILabel *label = [[[UILabel alloc] init] autorelease];
label.frame = CGRectMake(20, 6, 300, 30);
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.shadowColor = [UIColor grayColor];
label.shadowOffset = CGSizeMake(0.0, 1.0);
label.font = [UIFont boldSystemFontOfSize:14];
label.text = @"hello"; //sectionHeader;
return label;
}
When I compile, it simply displays with NO headings. I've also tried to add a view here too, as per the code below
UIView *sectionView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
sectionView.backgroundColor = [UIColor redColor];
[sectionView autorelease];
[sectionView addSubview:label];
return sectionView;
Am I doing something wrong?