Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
353 views
in Technique[技术] by (71.8m points)

iphone - Select all the cells in UITableView

what would be the best method to select all the cells in the table(UITableView) when the user presses a button in the tool bar?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here is my method to traverse a table, it works well.

for (int i = 0; i < [ptableView numberOfSections]; i++) {
    for (int j = 0; j < [ptableView numberOfRowsInSection:i]; j++) {
        NSUInteger ints[2] = {i,j};
        NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:ints length:2];
            UITableViewCell *cell = [ptableView cellForRowAtIndexPath:indexPath];
           //Here is your code

    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...