ios - 在 iOS 中重命名 EKCalendar

标签 ios objective-c calendar

如何更改日历的名称?我有:

EKCalendar *cal;

cal=[store calendarWithIdentifier:@"5F9A5BE0-03A9-4FE8-BD1E-2647F39E268F"];    

cal.title = @"Calendar custom 2";
cal.source = localSource;
NSError *error = nil;
BOOL saved = [store saveCalendar:cal commit:YES error:&error];
NSLog(@"%d -> %@",saved,error);

但这并没有保存,这个打印:

0 -> Error Domain=EKErrorDomain Code=15 "That calendar may not be moved to another account." UserInfo=0xb05c8a0 {NSLocalizedDescription=That calendar may not be moved to another account.}

有人可以帮助我!!

最佳答案

根据文档 source 无法更改,请尝试仅更改 title 属性。

关于ios - 在 iOS 中重命名 EKCalendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20957879/

相关文章:

php - 基于 php、mysql、javascript 的多用户基于 Web 的日历

ios - 如何将 JSON 字符串反序列化为 NSDictionary? (适用于 iOS 5+)

iphone - 索引 0 大小的 UITableView 单元格

android - 使用 ffmpeg 将图像即时编码为 mp4 视频

java - AES256加密 objective-c 实现

iphone - 向核心数据类添加自定义方法

android - Android 2.2 日历

jquery - 日期范围选择器无法正常工作

c# - 如何在Push Sharp库的APNS有效负载中添加类别以进行交互式通知iOS

ios - MVC 设计模式 iOS 中的项目结构