Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Become UIScrollViewDelegate delegate for UITableView

I have a UITableView instance variable. I want to be able to register my view controller to be the UIScrollViewDelegate for my UITableViewController. I have already tried

tableView.delegate = self; 

But when scrolling, my methods

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView                               willDecelerate:(BOOL)decelerate 

don't get called. Any suggestions?

like image 784
Brian Avatar asked Oct 23 '09 19:10

Brian


People also ask

What is UITableView delegate?

Methods for managing selections, configuring section headers and footers, deleting and reordering cells, and performing other actions in a table view.

What is Table View delegate and datasource?

Datasource methods are used to generate tableView cells,header and footer before they are displaying.. Delegate methods provide information about these cells, header and footer along with other user action handlers like cell selection and edit..


2 Answers

Now UITableViewDelegate conforms to UIScrollViewDelegate !

(I write this answer because many people are going to find this page googling..)

like image 120
Francescu Avatar answered Oct 06 '22 00:10

Francescu


UITableViewDelegate will implement UIScrollViewDelegate protocol also.

like image 43
Karthik Thirumalasetti Avatar answered Oct 05 '22 23:10

Karthik Thirumalasetti