找到了名为"location"的多个方法,其中包含不匹配的结果,参数类型或属性

use*_*154 2 calendar-store ios

我已经阅读了有关多种方法的其他问题,但仍然不知道如何修复我的代码.我很感激你的帮助.我在发生错误的语句周围放了一个*.

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: 
      (NSIndexPath *)indexPath
    {
    static NSString *CellIdentifier = @"eventCell";
    EQCalendarCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
       cell = [[EQCalendarCell alloc] initWithStyle:UITableViewCellStyleDefault
      reuseIdentifier:CellIdentifier];
    }
    cell.titleLabel.text = [[self.eventsList objectAtIndex:indexPath.row] title];
Run Code Online (Sandbox Code Playgroud)
    cell.locationLabel.text = [[self.eventsList objectAtIndex:indexPath.row] location];
Run Code Online (Sandbox Code Playgroud)
    NSDateFormatter *df = [[NSDateFormatter alloc] init];
    [df setDateFormat: @"dd-MM-yy HH:mm"];
    NSString *startDateString = [df stringFromDate:[[self.eventsList
    objectAtIndex:indexPath.row] startDate]];

    cell.startDateLabel.text = startDateString;

    NSString *endDateString = [df stringFromDate:[[self.eventsList
    objectAtIndex:indexPath.row] endDate]];


    cell.endDateLabel.text = endDateString;

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

提前感谢您的帮助.

bob*_*ble 7

self.eventsList集合中转换检索对象的结果应该可以解决问题.例如:

cell.locationLabel.text = [((MyClassName *)[self.eventsList objectAtIndex:indexPath.row]) location];

替换MyClassName集合中类的名称.