码迷,mamicode.com
首页 > 其他好文 > 详细

reloadSections

时间:2014-05-13 08:12:11      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:class   c   int   a   art   set   

self.isOpen = [NSMutableArray array];
    for (int j = 0; j < i; j++) {
        [self.isOpen addObject:[NSNumber numberWithInt:0]];
    }


-(void)buttonClick:(UIButton*)button

{

  

    NSNumber *num = self.isOpen[tag];
   
    if(num.intValue == 1){
        [self.isOpen removeObjectAtIndex:tag];
        [self.isOpen insertObject:[NSNumber numberWithInt:0] atIndex:tag];
    } else
    {
        [self.isOpen removeObjectAtIndex:tag];
        [self.isOpen insertObject:[NSNumber numberWithInt:1] atIndex:tag];
       
    }
    
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:tag] withRowAnimation:UITableViewRowAnimationFade];

}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

{

    return 2;

}

-(NSInteger)tableView:(UITableView *)tableViewnumberOfRowsInSection:(NSInteger)section

{

   

 NSNumber *num = [self.isOpen objectAtIndex:section];
     
        if(num.intValue == 1)
            
        {
            
            return 4;
            
        }else{
            
            return 0;
            
        }

}


reloadSections,布布扣,bubuko.com

reloadSections

标签:class   c   int   a   art   set   

原文地址:http://blog.csdn.net/qi_ruihua/article/details/25629399

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!