9宫格for循环
// 总数
NSUInteger totalCount = 9;
// 总列数
NSUInteger columnMaxCount = 6;
// 总行数
//NSUInteger row = (totalCount / columnMaxCount) + (totalCount % columnMaxCount == 0 ? 0 : 1);
for (int i = 0; i < totalCount; i++)
{
NSUInteger j = i % columnMaxCount; // 第j列
NSUInteger k = i / columnMaxCount; // 第k列
NSLog(@"%ld %ld",(long)j,k);
}