I know this is a pretty old question, but I just met the same problem. I donβt know exactly why, but it seems that tableFooterView can only be an instance of UIView (not βviewβ but βis a memberβ) ... Therefore, in my case, I created a new UIView object (like wrapperView) and add my own subordinate to it ... In your case, create code from:
CGRect footerRect = CGRectMake(0, 0, 320, 40); UILabel *tableFooter = [[UILabel alloc] initWithFrame:footerRect]; tableFooter.textColor = [UIColor blueColor]; tableFooter.backgroundColor = [self.theTable backgroundColor]; tableFooter.opaque = YES; tableFooter.font = [UIFont boldSystemFontOfSize:15]; tableFooter.text = @"test"; self.theTable.tableFooterView = tableFooter; [tableFooter release];
at
CGRect footerRect = CGRectMake(0, 0, 320, 40); UIView *wrapperView = [[UIView alloc] initWithFrame:footerRect]; UILabel *tableFooter = [[UILabel alloc] initWithFrame:footerRect]; tableFooter.textColor = [UIColor blueColor]; tableFooter.backgroundColor = [self.theTable backgroundColor]; tableFooter.opaque = YES; tableFooter.font = [UIFont boldSystemFontOfSize:15]; tableFooter.text = @"test"; [wrapperView addSubview:tableFooter]; self.theTable.tableFooterView = wrapperView; [wrapperView release]; [tableFooter release];
Hope this helps. This works for me.
zioolek Sep 20 '13 at 7:44 2013-09-20 07:44
source share