     override func viewDidLoad() {
         super.viewDidLoad()
         
-        crEvents = try! Realm().objects(CREvent.self)
-        
         waitForEventKitAuthorization()
-        
         initTimer = Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(eventKitAuthorized), userInfo: nil, repeats: true)
     }
     

        
        NotificationCenter.default.rx.notification(.NSCalendarDayChanged)
            .observeOn(MainScheduler.asyncInstance)
            .subscribe(onNext: { [unowned self] _ in self.notificationDealer() })
            .disposed(by:disposeBag)
    }
    

            .filter { date < $0.endDate }
    }
    
    private func notificationDealer() {
        if !currentObserveOnEventCalendar.refresh() ||  !currentWriteToReminderCalendar.refresh(){
            let alert = { () -> NSAlert in
                let a = NSAlert()
                a.alertStyle = .critical
                a.informativeText = "当前选定的日历被删除，请重新选择"
