导入ics文件,在iOS中创建事件

时间:2012-07-17 07:19:19

标签: ios import icalendar

我发现了一些关于SO的问题,甚至还有答案,但其中没有一个帮助我解决问题。 我有ICS文件

BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
DTSTART:20120719T110000
DTEND:20120719T120000
LOCATION:26 - 12 Hyde Way, Welwyn Garden Centre, Hertfordshire, AL7 3UQ
DESCRIPTION:You are going to be interviewed by: Paddy Allum - Group Health & Safety Manager and Heather Hughes - Group Training Manager
SUMMARY:CreativeSchool Group Plc
PRIORITY:3
END:VEVENT
END:VCALENDAR

我试图在它的本地文件时导入它:

NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES) objectAtIndex:0];
path = [path stringByAppendingPathComponent:@"appointment.ics"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
[[UIApplication sharedApplication] openURL:targetURL];

来自外部网址:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://mysite.com/appointment.ics"]];

直接加载到UIWebView但都失败了。在模拟器(没有日历应用程序)和设备上尝试。当尝试打开外部URL我收到警告“不可能订阅......某事blahblah”

有人可以给我一个线索吗? Apple宣布iOS 4.2将支持这些东西。

0 个答案:

没有答案