Cocoa touch 我无法在cocoa touch中获取表格视图单元格的值

Cocoa touch 我无法在cocoa touch中获取表格视图单元格的值,cocoa-touch,uikit,uitableview,Cocoa Touch,Uikit,Uitableview,我试图在表视图中获取单元格的值,但它不允许我这样做。如果有人能帮忙,那就太好了 int numberOfChecks = -1; numberOfChecks = numberOfChecks +1; if ([objectsForTable count]-1 >= numberOfChecks) { UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:numberOfChecks];

我试图在表视图中获取单元格的值,但它不允许我这样做。如果有人能帮忙,那就太好了

int numberOfChecks = -1;
numberOfChecks = numberOfChecks +1;

    if ([objectsForTable count]-1 >= numberOfChecks) {


        UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:numberOfChecks];

        NSString *cellTitle = cell.textLabel.text;

    }

CellForRowatineXpath:方法不是由UITableView提供的,该方法是由提供的。您应该在表中设置dataSource属性以指向您的委托,因为您必须提供数据。假设您这样做了,您可以使用表的dataSource属性调用您自己的数据源:

NSIndexPath *path = [NSIndexPath indexPathWithIndex: ... ];
UITableViewCell *cell = [self.tableView.dataSource tableView:self.tableView
                                       cellForRowAtIndexPath:path];