从iphone sdk中的服务器加载10个带图像的数据,所以请像我一样给我打电话
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
lastContentOffset = scrollView.contentOffset.y;
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)aScrollView{
//NSLog(@"lastContentOffset: %d",(int)aScrollView.contentOffset.y);
if (lastContentOffset < (int)aScrollView.contentOffset.y) {
NSArray *visibleRows;
NSIndexPath *path;
visibleRows = [tblStream visibleCells];
UITableViewCell *lastVisibleCell = [visibleRows lastObject];
path = [tblStream indexPathForCell:lastVisibleCell];
//NSLog(@"last cell: %d",path.row);
//NSLog(@"self.titlearray.count: %d",self.titlearray.count);
if(path.row+1 == arrFeedback_Info.count){
increment = (int)arrFeedback_Info.count;
increment =increment+10;
[self performSelector:@selector(Feedback_XML) withObject:nil afterDelay:0.0];
}
}
else if (lastContentOffset > (int)aScrollView.contentOffset.y) {
}
}
答案 0 :(得分:0)
你需要在numberofrow选择代码中执行类似的操作,然后才需要使用for循环逐个获取数据,然后更改行部分中的代码
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return data.count;
}