[[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]]的预期标识符

Coc*_*Dev 1 uitableview ios

我在if语句中继续获得预期标识符

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell1";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

        //NSDate *object = _objects[indexPath.row];

    if(cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]];
        // expected identifier
    }
Run Code Online (Sandbox Code Playgroud)

小智 8

这里:

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]];
       ^                                                                                                  ^
Run Code Online (Sandbox Code Playgroud)

你有一对额外的括号.最外面的一对是多余的.