"被调用的对象类型NSString不是函数或函数指针"错误?

bla*_*305 1 xcode objective-c

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    self.cellIdentifier = [self.brain returnCellIdentifier:indexPath];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier];

    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:self.cellIdentifier];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }

    cell.textLabel.text = [self.brain enchantmentCellText:indexPath];

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

我不知道为什么我会收到这个错误.错误似乎来自我的光标所在的行.我该如何解决这个错误:

Semantic issue
Called object type 'NSString *' is not a function or function pointer
Run Code Online (Sandbox Code Playgroud)

Jos*_*ick 19

我有这个确切的同样的错误,发现是因为我已经通过打字一切的元素手动创建一个数组它引起的,而忘记了一个逗号在他们两人之间.

  • 那也是我的问题。我花了几个小时才弄清楚为什么我的代码无法正常工作。我不知道为什么Xcode没有警告我有关逗号的信息。 (2认同)