質問

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