[ Click to return to the Blog Index ]

UITableView problem with iOS5

Must override heightForHeaderInSection…

2011 November 21

Today I found out that the iOS5 requires you to implement two UITableView delegate methods that you weren’t required to implement in the past. They are:


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section

I didn’t dig too much into why or what the exact scenario needs to be, but I had a view with two tables in it, one with multiple sections and section headers, the other with just one section, no headers. For the latter, I now need to return 0 on these two methods, otherwise you get weird-looking section headers.

commenting closed for this article

flickr

About me...

My real name is Allan and i'm 22 23 24 25 26 27 28 29 30 years old.

My mind, personality and the bunch of absurd posts that you'll read here have been influenced mostly by my career (Software Engineer), my exhobbie (Electronic Sports) and my past failure success failure success in love and relationships. Get ready for some a lot of sarcasm, irony, narcissism, egocentrism and a lot of other terms that end up with "ism"..., comedy and senseless stories about my life...

Search this blog...

Meet me on...

[ Facebook.com ] [ Last.FM ] [ Del.icio.us ] [ Twitter.com ] [ Hi5.com ]
[ Flickr.com ] [ LinkedIn.com ]