小编AYS*_*AYS的帖子

权限添加日历事件iOS

如果没有权限,我怎么能显示错误?(例如"你没有给我们留下你的日历中写的内容.").

这是我的代码:

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")) {

EKEventStore *es = [[EKEventStore alloc] init];
[es requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
    /* This code will run when uses has made his/her choice */
}];
}
        NSDateFormatter *   dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"ddMMyy"];

        NSString *fechainicio = datum;
        NSString *fechafin = datum;
        titel = [NSString stringWithFormat:@"%@ (%@)", titel, plaatslabel.text];

        NSDate * date = [[NSDate alloc] init];
        date = [dateFormatter dateFromString:fechainicio];
        NSDate * date2 = [[NSDate alloc] init];
        date2 = [dateFormatter dateFromString:fechafin];

        EKEventStore *eventStore …
Run Code Online (Sandbox Code Playgroud)

privacy ios eventkit

1
推荐指数
1
解决办法
5198
查看次数

标签 统计

eventkit ×1

ios ×1

privacy ×1