Hey Guys, please let me know how can I set this code action in to an UIButton action... Here is the code:
-(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;
}
i want to set above action in my button..
- (IBAction)displayRecord:(id)sender {
}
please tell me ...
content
array in your case. Once that is done, call[tableView reloadData]
. – Amar May 30 '13 at 12:52