我发现了一些关于 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 时,我收到一条警报“无法订阅……一些废话”
如果可能的话,谁能给我一个线索?Apple 宣布 iOS 4.2 将支持这些东西。