My table header shows up ok with Release build or Debug build for the iPhone simulator, but the header labels only show up with debug build on the iPhone. No header labels show up on the iPhone for release build.
Any ideas?
Thanks,
Robert
My code for the header is below
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)sectionNum
{
@try {
// create the parent view that will hold header Label
UIView* customView = [[[UIView alloc] initWithFrame:CGRectMake(HEADER_RELX_OFFSET, HEADER_RELY_OFFSET, HEADER_ROW_WIDTH, HEADER_HEIGHT)] autorelease];
UILabel* headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.opaque = NO;
headerLabel.numberOfLines = 0;
headerLabel.textColor = [UIColor blackColor];
headerLabel.highlightedTextColor = [UIColor whiteColor];
headerLabel.font = [UIFont boldSystemFontOfSize:HEADER_FONT_SIZE];
headerLabel.textAlignment = UITextAlignmentCenter;
headerLabel.lineBreakMode = UILineBreakModeWordWrap;
headerLabel.frame = CGRectMake(HEADER_RELX_OFFSET, HEADER_RELY_OFFSET, HEADER_ROW_WIDTH, HEADER_HEIGHT);
if(sectionNum == 0)
headerLabel.text = @"My Label";
else
headerLabel.text = @"";
[customView addSubview:headerLabel];
return customView;
@catch (NSException* exception) {
NSLog(@"viewForHeaderInSection: %@: %@",[exception name],[exception reason]);
}
}