[英]birthdayContactIdentifier BAD_ACCESS
When I access the property birthdayContactIdentifier from EKEvent I always instantly get a BAD_ACCESS error (not even able to nil check) 当我从EKEvent访问属性BirthdayContactIdentifier时,我总是立即收到BAD_ACCESS错误(甚至无法无效检查)
This is the code I am using to fetch 这是我用来获取的代码
import UIKit
import EventKit
class ViewController: UIViewController {
let eventStore : EKEventStore = EKEventStore()
override func viewDidLoad() {
super.viewDidLoad()
eventStore.requestAccessToEntityType(.Event) { (granted, error) in
if granted == true {
let startDate = NSDate()
let endDate = startDate.dateByAddingTimeInterval(7.0*86400.0)
let events = self.eventStore.eventsMatchingPredicate(self.eventStore.predicateForEventsWithStartDate(startDate, endDate: endDate, calendars: nil))
for event in events {
if event.calendar.type == .Birthday {
NSLog("\(event.title)")
NSLog("\(event.birthdayContactIdentifier)") // BAD_ACCESS
}
}
}
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.