vlasov / CCBottomRefreshControl

MIT License
319 stars 77 forks source link

Method target RefreshControl loop call #38

Open veila opened 6 years ago

veila commented 6 years ago

I have a problem when using bottomRefreshControl. When I load more data. In method callback from api. I endrefreshing the UIRefreshControl. But it still call the selector. This is my method.

-(void)loadFunItems{ [[NetworkManager manager] getListFunItemsByTagId:self.tagModel.tagId andPagenumber:[NSString stringWithFormat:@"%d",pageNumber] success:^(NSMutableArray results) { [self.refreshControl endRefreshing]; [self.loadMoreControl endRefreshing]; if(results.count > 0){ [listFunItems addObjectsFromArray:results]; [self.tableView reloadData]; } } failure:^(NSString error) { [self.refreshControl endRefreshing]; [self.loadMoreControl endRefreshing]; }]; }

-(void)loadMore{ pageNumber++; [self loadFunItems]; }

Fonger commented 6 years ago

same problem here after upgrade to iOS 11.1

veila commented 6 years ago

Hey guys, when we use xcode 9. the table always set estimate height row is auto, so the table always call cellForRow all cell. just turn off it in storyboard or set estimateheightRow = 0. Enjoy!

vyasdarshan commented 6 years ago

But After applying estimateRowHeight = 0, I am still facing the issue. Refresh selector method is being called in the loop.

veila commented 6 years ago

How many row in your table? They visible all? and which index row you call the refresh selector?

vyasdarshan commented 6 years ago

I have total 50 records. And I call refresh selector in scrollDidSelect delegate method of scroll view.

Arpit723 commented 6 years ago

thanks @veila tableView.setEstimateHeightRow = 0 works. Now, CCBottomPullToRefresh does not loop call automatically