I am adding image in tableVIew cell but it does not show. I am using if condition to give the image to button but it does not show.
Here is the code for the button addding
addButton = [UIButton buttonWithType:UIButtonTypeCustom];
addButton.Frame=CGRectMake(590,2,42,42);
[addButton addTarget:self action:@selector(tab1Action:) forControlEvents:UIControlEventTouchUpInside];
addButton.tag=indexPath.row;
NSString*test=theData.Status;
if ([test isEqualToString:@"1"]) {
test=@"Already Member of the group";
}
else {
test=@"";
NSLog(@"Else is also Working Fine");
[addButton setImage:[UIImage imageNamed:@"addbutton.png"] forState:UIControlStateNormal];
}
addButton.clipsToBounds=YES;
[[cell contentView] addSubview:addButton];
cell.textLabel.font=[UIFont fontWithName:@"Helvetica" size:16];
cell.textLabel.text=[NSString stringWithFormat:@"%@: %@",theData.GroupTitle,test];
return cell;