Hi,
i need your help guys

i have Load more button with TableFooterView and when i scroll down to the last cell its Automatically load more cells to the table. so Its Working but there is kind of bug if i scroll down to the last cell and then immediately do it again (scroll up and down to the last cell) its called 2 times.
i need to find a way that even if i "play" with the last cell its called only once until the task is over and then enable it again.
i know that i need to use bool but i dont know how, where and when to do it...
Code:
viewDidLoad
Code:
//set tableview footer
[[NSBundle mainBundle] loadNibNamed:@"ActivityIndicator-iPhone" owner:self options:nil];//this gets a new instance from the xib
self.footerActivityIndicator=self.activityIndicator;
[[self tableView] setTableFooterView:[self activityIndicatorView]];
Code:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (([scrollView contentOffset].y + scrollView.frame.size.height) == [scrollView contentSize].height) {
NSLog(@"scrolled to bottom");
[[self footerActivityIndicator] startAnimating];
[self performSelector:@selector(stopAnimatingFooter) withObject:nil afterDelay:0.5];
}
return;
}
Code:
//stop the footer spinner
- (void) stopAnimatingFooter{
//add the data
[[self footerActivityIndicator] stopAnimating];
[self addItemsToEndOfTableView];
[[self tableView] reloadData];
}
Code:
- (void) addItemsToEndOfTableView{
NSLog(@"addItemsToEndOfTableView");
// Parse
NSURL *feedURL = [NSURL URLWithString:@"http://gdata.youtube.com/feeds/api/users/RayWilliamJohnson/uploads?v=2&alt=rss&sort_field=added&start-index=21&max-results=20"];
feedParser = [[MWFeedParser alloc] initWithFeedURL:feedURL];
feedParser.delegate = self;
feedParser.feedParseType = ParseTypeFull; // Parse feed info and all items
feedParser.connectionType = ConnectionTypeAsynchronously;
[feedParser parse];
}