I want to add image on tableview. i create one UITableViewCell object. in .h file
@interface MainView1 : UITableViewCell{
IBOutlet UILabel *cellText;
IBOutlet UIImageView *productImg;
IBOutlet UILabel *cellText1;
}
- (void)LabelText:(NSString *)_text;
- (void)LabelText1:(NSString *)_text;
- (void)ProductImage:(NSString *)_text;
@end
and .m file
- (void)LabelText:(NSString *)_text;{
cellText.text = _text;
}
- (void)LabelText1:(NSString *)_text;{
cellText1.text=_text;
}
- (void)ProductImage:(NSString *)_text;{
productImg.image = [UIImage imageNamed:_text];
}
and in main file
//page contains table
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MainView1 *cell = (MainView1 *)[tableView dequeueReusableCellWithIdentifier: MyIdentifier];
if(cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"MainView1" owner:self options:nil];
cell = tableCell1;
[cell LabelText:[arryList objectAtIndex:indexPath.row]];
[cell ProductImage:[imgNameArray objectAtIndex:indexPath.row]];
[cell LabelText1:[yesArray objectAtIndex:indexPath.row]];
}
image array is coming from database like this
NSData *imgdata=[[NSData alloc]initWithBytes:sqlite3_column_blob(cmp_sqlstmt,0) length:sqlite3_column_bytes(cmp_sqlstmt,0)];
[imgNameArray addObject:dataImage];
problem is only image is not showing error showing is unrecognized selector sent to instance 0x4e53940'
how to solve it Regards K L BAIJU