나는 그 안에 3 개의 열과 5 개의 값이있는 2 개의 행을 가진 테이블을 가지고 있습니다. 이 값은 3 열에 연속적으로 표시되어야합니다.값이 3 열로 채우기 테이블 행
indexPath.row 0: Array[0] | Array[1] | Array[2]
indexPath.row 1: Array[3] | Array[4] |
내 값을두고 일부 코드를 만들려면 (이 상관하지 않는다 얼마나 예를 들면 5,6,7, ..., 20, 21 행 3 열의 형식) 행은 값이있는 배열의 크기로 계산됩니다.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSMutableArray *values = [... getValues];
int no=0;
if (values) {
no=(values.count+1)/3;
}
else{
no=0;
}
return no;
}
현재 문제는 열에 5 개의 값이 분산되어 있습니다. 내가 계산과 주변 struggeling있어 , 이들은 ... 배열의 인덱스
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//order values in 3 columns and 2 rows (currently)...
}
BR, mybecks