[IOS]UITableView重用(使用多个自定义Cell)

[IOS]UITableView重用(使用多个自定义Cell)


#import "RemindInfoCell.h"
#import "ToDoCell.h"
#import "MessageCenterCell.h"

@interface RemindInbox ()<UITableViewDataSource,UITableViewDelegate>

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     static NSString *cellIdentifier=@"cell";
    UITableViewCell *theCell;
    //文件审批提醒
    if([[self.judgeStr isEqualToString:@"1"]){
        RemindInfoCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if (!cell) {
            cell=[[RemindInfoCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
        }
        theCell = cell;
        //赋值
        [(RemindInfoCell *)theCell cValuationWithDate:@"05-07" andTime:@"13:23" andContent:@"文 收件箱——文 收件箱——文 收件箱——文 收件箱——文 收件箱——文 收件箱——文 收件箱——" andReadAlready:YES andHeight:60];
        
    //重大事件提醒
    }else if([[self.judgeStr isEqualToString:@"2"]){
        RemindInfoCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if (!cell) {
            cell=[[RemindInfoCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
        }
        theCell = cell;
        //赋值
        [(RemindInfoCell *)theCell cValuationWithDate:@"10-21" andTime:@"20:32" andContent:@"重 收件箱——重 收件箱——重 收件箱——重 收件箱——重 收件箱——重 收件箱——重 收件箱——重 收件箱——重 收件箱——" andReadAlready:YES andHeight:60];
        
    //代办事项
    }else if([[self.judgeStr isEqualToString:@"3"]){
        ToDoCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if (!cell) {
            cell=[[ToDoCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
        }
        theCell = cell;
        //赋值
        [(ToDoCell *)theCell cValuationWithDate:@"07-21" andTime:@"20:32" andTodoTime:@"2014年5月26日 11:02" andContent:@"待 收件箱——待 收件箱——待 收件箱——待 收件箱——待 收件箱——待 收件箱——待 收件箱——" andReadAlready:NO  andHeight:70];
        
    //消息中心
    }else if([[self.judgeStr isEqualToString:@"4"]){
        MessageCenterCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if (!cell) {
            cell=[[MessageCenterCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
        }
        theCell = cell;
        //赋值
        [(MessageCenterCell *)theCell cValuationWithDate:@"11-25" andTime:@"14:26" andLinkMan:@"王主任" andContent:@"消 收件箱——消 收件箱——消 收件箱——消 收件箱——消 收件箱——消 收件箱——消 收件箱——" andReadAlready:YES andUnreadNum:23 andHeight:60];
        
    }
    theCell.backgroundColor=[UIColor clearColor];
    [theCell setClipsToBounds:YES];
   return theCell;
}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值