2010-06-14 1 views
0

RSS 피드를 텍스트 및 이미지와 함께 테이블에 표시하는 앱을 만들려고 노력하고 있습니다.하지만 정말 힘들어요! IPhone-Rss 샘플 코드, 수정하여 이미지 표시 ... 도움을 청하십시오!

나는 정말 좋은 [샘플 코드 프로젝트]를 발견 [1] 난 정말 recommend--하지만 메신저 struggeling 내가 가진 reeeeally 행복 할 것이다 그것은 단지 텍스트

대신 tablecells에 이미지를 표시하기 위해 점점 수 어떤 도움 !!

감사

답변

0

는 테이블의 셀에 UIImageView을 추가하고 이미지에 image 숙박 시설의 설정. 당신은 당신의 cellForRowAtIndexPath: 방법에서이 작업을 수행 할 것 : 비동기 접근 밖으로 this article

-(UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    static NSString *MyIdentifer = @“MyIdentifier”; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; 

    if(cell == nil) { 
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero 
     reuseIdentifier:MyIdentifier] autorelease]; 

    UIImageView *imgView = [[UIImageView alloc] initWithFrame: CGRectMake(3,3,75,75)]; 
    imgView.tag = 7; 
    } 


    [cell setText: (NSString*)[yourTextArray objectAtIndex: indexPath.row]; 

    UIImageView *theImgView = (UIImageView*)[cell viewWithTag: 7]; 
    theImgView.image = (UIImage*)[yourImageArray objectAtIndex: indexPath.row] 


    return cell; 
} 

확인합니다.