关于UITableView如何跳转到最后一行或者任意指定行

关于UITableView如何跳转到最后一行或者任意指定行。
其实现如下:
    NSUInteger sectionCount = [self.tableView numberOfSections];
    if (sectionCount) {
 
        NSUInteger rowCount = [self.tableView numberOfRowsInSection:0];
        if (rowCount) {
 
            NSUInteger ii[2] = {0, rowCount - 1};
            NSIndexPath* indexPath = [NSIndexPath indexPathWithIndexes:ii length:2];
            [self.tableView scrollToRowAtIndexPath:indexPath 
             atScrollPosition:UITableViewScrollPositionBottom animated:YES];
        }
    } 


posted @ 2012-11-08 09:06  沙影无痕  阅读(380)  评论(0编辑  收藏  举报