2

複数の方法に関する他の質問を読みましたが、コードを修正する方法がまだわかりません。これについて助けていただければ幸いです。エラーが発生したステートメントを *で囲みました。

    - (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];

    cell.locationLabel.text = [[self.eventsList objectAtIndex:indexPath.row] location];

    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;
    }

よろしくお願いいたします。

4

4 に答える 4

1

EKEvent クラスをキャストする必要があります。これはあなたの問題を解決します...

EKEvent *event = [self.eventlist objectAtIndex:indexPath.row];
NSString *placeStr=[event location];
于 2014-06-11T10:09:42.027 に答える