iOS – Event Kit programming listen to notifications

I want to observe changes to the Calendar application so I register for the EKEventStoreChangedNotification notification. But do I need to have an EKEventStore object "alive" for me to receive this notification? I'm thinking I'm initializing the EKEventStore object in on view controller to retrieve some events. And then I will pop this view controller of the navigation stack and the view controller will be deallocated thus the EKEventStore object will be deallocated.

Answers


No, you don't need to keep the EKEventStore object alive as you are already registering EKEventStoreChangedNotification using EKEventStore object named eventStore

[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(storeChanged:)
                              name:EKEventStoreChangedNotification  object:eventStore];

Refer this for more clearance of your doubt


Need Your Help

JavaScript halts in inactive android Chrome tab

javascript android google-chrome

I have a tiny webpage that streams music that I can listen to on my phone. The JavaScript on the page sets a timeout that loads the next song and plays it when the first song is over.

How can I create a maven artifact that is compatible with exactly two versions of another artifact?

maven

I need to create a maven artifact (org.foo.bar:blarb:1.0.0) that is dependent on exactly two versions of another artifact (org.blab.har:har:1.7.0 and org.blab.har:har:1.8.0, 1.7.1 and 1.8.1 are not