是否有任何客观的C API或对象可以让我访问iCal及其事件?我需要阅读给定日期的日历事件,并可选择设置新事件.
代码是普通C或目标C(在程序的GUI版本中).我在mac os 10.6上使用xcode.
非常感谢示例代码.
我已经阅读了有关多种方法的其他问题,但仍然不知道如何修复我的代码.我很感激你的帮助.我在发生错误的语句周围放了一个*.
- (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)
提前感谢您的帮助.