iOS traverse all the TableView Cell

- (NSArray *)cellsForTableView:(UITableView *)tableView{

    NSInteger sections = tableView.numberOfSections;

    NSMutableArray *cells = [[NSMutableArray alloc] init];

    for (int section = 0; section < sections; section++) {

        NSInteger rows = [tableView numberOfRowsInSection:section];

        for (int row = 0; row < rows; row++) {

            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];

            [cells addObject:[tableView cellForRowAtIndexPath:indexPath]];

        }

    }

    return cells;

}

 

There is no test can not be multiplexed pools Cell

Published 49 original articles · won praise 7 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_29680975/article/details/100985953