iphone - 订阅 url 以在 ical 中添加事件
<p><p>我想使用 eventkit 将服务器中的事件添加到 ical 中。我可以通过编程方式订阅一个 url,以便所有事件都可以在 ical 应用程序中自动同步。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>Synchronization is done from your side (Inside objective "c"). You need to fetching all events from server after hitting appropriate URL.
Parse it and save single event with the help of below method:
-(void)addingEvents{
EKEventStore *eventStore = [ init];
EKEvent *event= ;
event.title = <<Event Title>>;
NSDateFormatter *dateFormatter = [ init];
;
];
NSString *strDate = ;
NSDate *startDate = ;
;
event.startDate = [ initWithTimeInterval:0 sinceDate:startDate];
event.endDate = [ initWithTimeInterval:600 sinceDate:event.startDate];
NSArray *alertArray = ];
event.alarms = alertArray;
];
NSError *err;
;
if (err) {
NSLog(@"Error occured : %@",);
}
;
}
</code></pre></p>
<p style="font-size: 20px;">关于iphone - 订阅 url 以在 ical 中添加事件,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/15292515/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/15292515/
</a>
</p>
页:
[1]