2012-02-15 5 views
-3

나는 mutArray, ageArray, jobArray라는 배열을 변경할 수 있습니다. NSString에 모든 3 개의 배열을 넣고 싶습니다. 그래서 UITableView의 단일 셀에 모든 세부 정보를 표시 할 수 있습니다. 나타납니다. 이NSString에 NSmutable 배열 넣는 방법

이름 세

- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath { 
    //etc.... 
    cell.textLabel.text = [stringObject objectAtIndex:indexPath.row]; 
} 

답변

2

I t 당신이 배열의 요소가 무엇인지에 따라 달라집니다 작업있다. 문자열 인 경우 다음과 같이 사용할 수 있습니다.

cell.textLabel.text = [NSString stringWithFormat:@"%@ %@ %@", [nameArray objectAtIndex:indexPath.row], [ageArray objectAtIndex:indexPath.row], [jobArray objectAtIndex:indexPath.row]]; 
+0

이름, 나이, 작업이 동일한 셀에 나타나기 때문에 셀 크기가 변경됩니까? 셀의 극단 오른쪽에 매개 변수를 "age"할 수 있고 작업이 이름 제목 아래에 있어야합니다. 이름, 나이, 직업 데이터가 자동으로 여러 개있는 경우 셀의 나머지 부분에 적용됩니까? – bazinga

관련 문제