2012-03-04 3 views
1
ContactInfo *data = [self.contacts objectAtIndex:[indexPath row]]; 

cell.textLabel.text = data.name; 
cell.detailTextLabel.text = data.designation; 
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 


NSString *filePath = [[NSBundle mainBundle] pathForResource:data.image ofType:@"png"]; 

NSLog(@"%@",filePath); 

UIImage *image1 = [UIImage imageWithContentsOfFile:filePath]; 
cell.imageView.image = image1; 

return cell; 

여기서 올바른 셀 데이터와 세부 텍스트 레이블을 얻지 만 이미지 뷰에는 다른 이미지가 필요하지 않습니다. 어느 누구라도 조언을 할 수 있다면.SQL 데이터베이스에서 테이블 뷰 셀로 이미지로드

+0

NSLog의 출력은 무엇입니까? – Geoffroy

답변

0

하면 Fetch image from database in Iphone

을 따를 수
NSString *filePath = [[NSBundle mainBundle] pathForResource:data.image ofType:@"png"]; 
    NSData *imageData=[NSData dataWithContentsOfURL:[NSURL URLWithString:filePath]]; 

    UIImage *itemImage=[[UIImage alloc]initWithData:imageData cache:YES] ; 

지금 자세한 내용은

cell.imageView.image = itemImage; 

이 이미지 오브젝트를 사용을 NSData 같은 데이터베이스에서 이미지를 검색 한 다음이있는 NSData 객체와 이미지 개체를 초기화

+0

@ user1203289이 코드를 구현 했습니까 ?? –

+0

예. 감사합니다. –

관련 문제