0
나는 이것을 위해 Google 검색을 보냈지 만, 나는 내가 원하는 것을 얻을 수 없다.iPhone dev 질문 도움 전화 번호 배열
다른 아이콘이있는 사용자 정의 테이블보기 셀을 단면 표보기로 만듭니다. 내 문제는 배열에서 이러한 이미지를 읽는 데 문제가 있다는 것입니다. 나는 아래처럼 그것을 할 수 있지만 누군가 배열에서이 일을 도와 줄 수 있습니다.
작업 긴 양식 코드 :
switch (indexPath.row) {
case 0:
imageView2.image = [UIImage imageNamed:@"ico-company.png"]; break;
case 1:
imageView2.image = [UIImage imageNamed:@"ico-value.png"];
case 2:
imageView2.image = [UIImage imageNamed:@"ico-date.png"]; break;
case 3:
imageView2.image = [UIImage imageNamed:@"ico-notes.png"];break;
default:
break;
}
그리고 나는이 같은 것을보고 얻을 수 있다고 생각 : 내가 원하는 방법
작동하지 않는다 코드를
arryImages = [[NSMutableArray alloc] init];
arryImages = [NSArray arrayWithObjects:
[UIImage imageNamed: @"ico-company.png"],
[UIImage imageNamed: @"ico-value.png"],
[UIImage imageNamed: @"ico-date.png"],
[UIImage imageNamed: @"ico-notes.png"], nil];
imageView2.image = [UIImage imageWithContentsOfFile:[arryImages objectAtIndex:[indexPath row]]];
그리고 이 배열 코드를 시도 할 때 오류가 있습니다 :
2010-01-18 13:20:47.314 SQL[60921:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIImage length]: unrecognized selector sent to instance 0x39135c0'
감사
완벽한 답변! – oberbaum