小编php*_*xin的帖子

如何通过indexPath获取uitableViewCell?

我怎样才能获得UITableViewCell通过indexPath?像这样:

我使用UIActionSheet,当我点击确认UIButton我想要更改单元格文本.

nowIndex我定义为一个属性

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 0)
    {
        NSInteger section =  [nowIndex section];
        NSInteger row = [nowIndex row];
        NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
        formatter.dateFormat = @"yyyy-MM-dd";

        if (section == 0)
        {
            if (row == 0)
            {

            }
            else if (row == 1)
            {
                UILabel *content = (UILabel *)[[(UITableView *)[actionSheet ] cellForRowAtIndexPath:nowIndex] viewWithTag:contentTag];
                content.text = [formatter stringFromDate:checkInDate.date];
            }
            else if (row == 2)
            {

            }
        } …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview nsindexpath

68
推荐指数
6
解决办法
12万
查看次数

标签 统计

iphone ×1

nsindexpath ×1

uitableview ×1