2011-10-26 3 views
0

배열 배열로 tableview를 채 웠지만 텍스트를 셀 레이블로 표시하는 방법을 모르겠습니다.tableview 셀에 텍스트 레이블을 표시하는 방법

배열 안에있는 배열의 "0"위치에있는 문자열을 텍스트 레이블로 사용하고 싶습니다.

감사합니다. 당신은 배열의 배열이 있기 때문에 배열 내의 배열에 접근 할 필요가

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

    static NSString *CellIdentifier = @"cell"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 
    } 

    // Set up the cell... 
    cell.textLabel.text = [excersizeArray objectAtIndex:indexPath.row];  
    return cell; 
} 

답변

0

: 여기

내 코드의

cell.textLabel.text = [[excersizeArray objectAtIndex:indexPath.row]objectAtIndex:0]; 

이 얻을 인덱스 indexPath.row의 배열의을 (테이블의 행) exercisesArray.

[excersizeArray objectAtIndex:indexPath.row] 

이 배열 (내부 배열)에서 얻은 문자열입니다.

+0

대단히 감사합니다! – novicePrgrmr

관련 문제