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)
提前感谢您的帮助.
从self.eventsList集合中转换检索对象的结果应该可以解决问题.例如:
cell.locationLabel.text = [((MyClassName *)[self.eventsList objectAtIndex:indexPath.row]) location];
替换MyClassName集合中类的名称.
| 归档时间: |
|
| 查看次数: |
3123 次 |
| 最近记录: |