Iphone 在iOS 4.0中订阅网络广播URL

Iphone 在iOS 4.0中订阅网络广播URL,iphone,events,eventkit,Iphone,Events,Eventkit,在我的iPhone应用程序中,我有一个按钮,可以在UIWebView中打开webcal://URL,如下所示: #define kHostName @"webcal://www.markthisdate.com/kalender/World_Cup_Football_2010_Match_Schedule_10251.ics" - (IBAction)putInCalendar:(id)sender{ NSURL *url = NULL; url = [[NSURL

在我的iPhone应用程序中,我有一个按钮,可以在UIWebView中打开webcal://URL,如下所示:

#define kHostName @"webcal://www.markthisdate.com/kalender/World_Cup_Football_2010_Match_Schedule_10251.ics"

    - (IBAction)putInCalendar:(id)sender{
     NSURL *url = NULL;
     url = [[NSURL alloc] initWithString:kHostName];
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url];
     [webView loadRequest: request];
     [request release];
     [url release];
    }
在iOS 3.x中,这会触发一系列对话框“订阅日历…”等,类似于在Mobile Safari中打开同一URL时所发生的情况:关联事件将作为对iPhone日历的订阅添加

在iOS 4.0中,虽然在iOS 4.0中的Mobile Safari中打开URL确实有效,但在我的应用程序中,这并不起作用

有谁能向我解释一下为什么这不起作用,但更好的是:iOS 4.x如何实现这一功能


我看了一下添加到4.0中的新事件工具包,因为它似乎在处理这类事情;然而,关于Event Kit的文档非常贫乏,我还没有找到任何使用Event Kit的示例项目。

苹果公司已经承认这是一个bug,我已经将其归档。目前没有解决方法……

只需输入此代码并检查

#define kHostName @"webcal://www.markthisdate.com/kalender/World_Cup_Football_2010_Match_Schedule_10251.ics"

[[UIApplication sharedApplication]openUrl:[NSUrl urlWithString:[NSString stringWithFormat:@"%@",KHostName];

这在最新版本中仍然有效。哪些版本不起作用?哦,苹果。。。