zoukankan      html  css  js  c++  java
  • 刷新代码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币”即可。

  • 相关阅读:
    [SpriteKit] 制作瓦片地图小游戏
    TouchID 指纹解锁
    iOS-启动动态页跳过设计思路
    iOS-高仿通讯录之商品索引排序搜索
    Python: PS 滤镜--马赛克
    Tensorflow学习笔记——占位符和feed_dict(二)
    Tensorflow学习笔记——张量、图、常量、变量(一)
    IDEA 单元测试
    sublime —— 强大的插件
    window环境下在anconda中安装opencv
  • 原文地址:https://www.cnblogs.com/jiangu66/p/3067682.html
Copyright © 2011-2022 走看看