刷新代码IOS 上拉分页刷新--

PS:今天上午,非常郁闷,有很多简单基础的问题搞得我有些迷茫,哎,代码几天不写就忘。目前又不当COO,还是得用心记代码哦!

//放到每次刷新中(分程线和下拉刷新公用)
iListCountNum=1;
isEndList=NO;
///////////////具体代码如下--
    每日一道理
盈盈月光,我掬一杯最清的;落落余辉,我拥一缕最暖的;灼灼红叶,我拾一片最热的;萋萋芳草,我摘一束最灿的;漫漫人生,我要采撷世间最重的———毅力。
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    //NSLog(@"%d",m_tieziList.count);
    NSLog(@"%d",indexPath.row);
    if(indexPath.row==(m_tieziList.count-1)&&isEndList==NO)
    {
        iListCountNum++;
        NSLog(@"%d",indexPath.row);
        NSThread *InitThread = [[NSThread alloc]initWithTarget:self selector:@selector(GetNewListThread:) object:tableView];
        [InitThread start];
        
        
        
    }
}
-(void)GetNewListThread:(id)sender
{
    NSMutableArray *array =[g_data GetTieziList:m_forumNode->forum_id pageSize:9 pageNum:iListCountNum];
    if(array.count == 0)
    {
        isEndList = YES;
    }
    else
    {
        isEndList=NO;
    }
    [m_tieziList addObjectsFromArray:array];
    [self performSelectorOnMainThread:@selector(ReLoadTableData:) withObject:(UITableView*)sender waitUntilDone:NO];
}
-(void)ReLoadTableData:(id)sender
{
    UITableView *table = (UITableView*)sender;
    [table reloadData];
    
}

文章结束给大家分享下程序员的一些笑话语录: 腾讯总舵主马化腾,有人曾经戏称如果在Z国选举总统,马化腾一定当选,因为只要QQ来一个弹窗”投马总,送Q币”即可。

posted @ 2013-05-08 20:22  坚固66  阅读(256)  评论(0编辑  收藏  举报