-1

Hey Guys、このコード アクションを UIButton アクションに設定する方法を教えてください...コードは次のとおりです。

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

NSString *myIdentiFier=@"myIdentiFier";

myCell *cell=[tableView dequeueReusableCellWithIdentifier:myIdentiFier];

if(!cell){
    //cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:myIdentiFier];
    NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"myCell" owner:self options:nil];
    for(id obj in nib){
        if([obj isKindOfClass:[myCell class]]){
            cell=(myCell *)obj;
            break;
        }
    }
}

NSDictionary *diction=(NSDictionary*)[content objectAtIndex:indexPath.row];
[cell.contentView setBackgroundColor:[UIColor orangeColor]];

cell.empID.text=[diction objectForKey:@"empid"];
cell.empName.text=[diction objectForKey:@"empname"];
cell.designation.text=[diction objectForKey:@"empdesignation"];
cell.teamName.text=[diction objectForKey:@"empteam"];

return  cell;

}

ボタンに上記のアクションを設定したい..

- (IBAction)displayRecord:(id)sender {
}

教えてください ...

4

2 に答える 2

0

あなたは電話することができます

[tableview reloadData]

cellForRowAtIndexPath が呼び出されるよりも。

于 2013-05-30T12:50:34.693 に答える
0

単にあなたは次のようにすることができます

- (IBAction)displayRecord:(id)sender {
           [yourTablename reloadData];
}
于 2013-05-30T12:52:22.637 に答える