views:

32

answers:

2

Hi all,

I have added a view at the end of tableview and I needed to check a condition for the cell pull offset for which I wanted obtain the y-coordinate of contentoffset of the end of tableview. I'm checking for the offeset at the start of tableview like this :

    if (refreshHeaderView.isFlipped && scrollView.contentOffset.y > -65.0f && scrollView.contentOffset.y < 0.0f && !reloading) 

This checks for the condition that the cell is pulled beyond 65 pixels or not.

The same way I wanted to write the condition for the view at the end of tableview wheather the last cell is pulled beyond some 65 pixels or not. How do i check it?

Thanx in advance.

A: 

I approached this problem before and my way is to manually calculate the table view height using number of rows in table * table.rowHeight then I can know the total height of the table view. And using that total height + 65

vodkhang
Except that doesn't work if you have table headers/footers, section headers/footers, variable row size...
tc.
+1  A: 
tableView.contentSize
tc.
Thanx tc. It helped...
neha
Can I ask a stupid question? How can you know there is a property called contentSize in tableView? I tried to look in the UITableView Class Reference but still can not see it:http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006943-CH3-SW30
vodkhang
UITableView is a UIScrollView.
tc.