小编amu*_*cia的帖子

将我的应用中的.ics文件添加到iOS日历中

我有一个日历(.ics文件).我想创建一个按钮,单击该按钮,打开iCal文件iOS Calendar并询问您是否要将其添加到您的iOS Calendar(如在互联网上的某些网站上:http://icaltv.com/calendars/all-tv-shows/)

那可能吗?

我尝试打开它,UIDocumentInteractionController但没有用.

谢谢你提前.

编辑:

我找到的临时解决方案是:

NSString *url = @"webcal://url.ics";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
Run Code Online (Sandbox Code Playgroud)

calendar objective-c ios

5
推荐指数
0
解决办法
885
查看次数

在事务中调用的Objective-C + [CATransaction synchronize]

我有这个错误: +[CATransaction synchronize] called within transaction但我不明白这是什么意思.

我检测到此行发生错误:

-(void)NSURLConnectionFunction:(NSString *)feedURLString
{
    @try{
        m_stopRunLoop = NO;

        NSData *postData = [feedURLString dataUsingEncoding:NSUTF8StringEncoding];
        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:feedURLString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:180];
        NSString *postLength = [[NSString alloc] initWithFormat:@"%d", [postData length]];
        [request setHTTPMethod:@"POST"];
        [request setValue:postLength forHTTPHeaderField:@"Content-Length"];

        NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];

        if(conn){
            webData=[NSMutableData data];
        }
        do
        {
            // ERROR APPEAR HERE
            NSDate* cycle = [NSDate dateWithTimeIntervalSinceNow:0.5];
            [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
                                     beforeDate:cycle];
        }
        while ( ! m_stopRunLoop );
    }
    @catch (NSException *e){
        NSLog(@"Exception %@",e); …
Run Code Online (Sandbox Code Playgroud)

objective-c ios

5
推荐指数
0
解决办法
7012
查看次数

标签 统计

ios ×2

objective-c ×2

calendar ×1