Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 加载.ics文件以从应用程序添加日历事件_Ios_Objective C - Fatal编程技术网

Ios 加载.ics文件以从应用程序添加日历事件

Ios 加载.ics文件以从应用程序添加日历事件,ios,objective-c,Ios,Objective C,要从url加载.ics文件,我使用如下的OpenURL方法 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fullURL]]; 很好用。 但我想从应用程序包中加载.ics文件,而不使用URL。例如,我有一个文件是test.ics文件如何加载这个文件,我们可以在没有URL的情况下加载它吗?您可以在本地加载ics文件 NSURL *path = [[NSBundle mainBundle] URLForResourc

要从url加载.ics文件,我使用如下的OpenURL方法

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:fullURL]];
很好用。
但我想从应用程序包中加载.ics文件,而不使用URL。例如,我有一个文件是test.ics文件如何加载这个文件,我们可以在没有URL的情况下加载它吗?

您可以在本地加载
ics
文件

NSURL *path = [[NSBundle mainBundle] URLForResource:@'icsName' withExtension:@'ics'];
[[UIApplication sharedApplication] openURL:path];


您可以在本地加载
ics
文件

NSURL *path = [[NSBundle mainBundle] URLForResource:@'icsName' withExtension:@'ics'];
[[UIApplication sharedApplication] openURL:path];


您可以在本地加载
ics
文件

NSURL *path = [[NSBundle mainBundle] URLForResource:@'icsName' withExtension:@'ics'];
[[UIApplication sharedApplication] openURL:path];


您可以在本地加载
ics
文件

NSURL *path = [[NSBundle mainBundle] URLForResource:@'icsName' withExtension:@'ics'];
[[UIApplication sharedApplication] openURL:path];


谢谢,我可以用上面的方式作为url,加载文件时不会发生任何事情。我的意思是它没有加载文件。谢谢,我可以用上面的方法作为url,加载文件时不会发生任何事情。我的意思是它没有加载文件。谢谢,我可以用上面的方法作为url,加载文件时不会发生任何事情。我的意思是它没有加载文件。谢谢,我可以用上面的方法作为url,加载文件时不会发生任何事情。我的意思是它没有加载文件。