Вопрос

Sorry for maybe stupid question, I am a very beginner. In some test code for iOS I see:

UITableViewCell *cell = cellsArray[indexPath.section][indexPath.row];

How can I spell out right part of this statement? Thanks for help!

Это было полезно?

Решение

This is an exact equivalent of:

[[cellsArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];

cellsArray is an array of arrays, a 2-dimensional array. its count is number of sections in table view. every array represents a section and contains cells for this section. so you can access each cell by its row

Другие советы

you have to make 2D array:

UITableViewCell *cell = [[cellsArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top