I'm not sure if this is an issue, or if I'm misunderstanding something. When I create a session, as the MQTTSession header suggests, I immediately set the persistence flag to true with an MQTTCoreDataPersistence object. However, since there's no initializer for the MQTTCoreDataPersistence type that takes a persistence value, by the time createPersistentStoreCoordinator: is called, persistence is still set to the default of NO, so the persistent store isn't created with my YES (true).
What this means for me is that if I start my app either with airplane mode on, or disabling it soon after launch, attempt to publish some data, and then kill the app before ever restoring the connection, the data is not available and attempting to publish on the next instance. However, I tried setting the default value for persistence to yes rather than no, and everything worked as expected.
For what it's worth, here's my session initialization:
I'm not sure if this is an issue, or if I'm misunderstanding something. When I create a session, as the MQTTSession header suggests, I immediately set the persistence flag to true with an MQTTCoreDataPersistence object. However, since there's no initializer for the MQTTCoreDataPersistence type that takes a persistence value, by the time createPersistentStoreCoordinator: is called, persistence is still set to the default of NO, so the persistent store isn't created with my YES (true).
What this means for me is that if I start my app either with airplane mode on, or disabling it soon after launch, attempt to publish some data, and then kill the app before ever restoring the connection, the data is not available and attempting to publish on the next instance. However, I tried setting the default value for persistence to yes rather than no, and everything worked as expected.
For what it's worth, here's my session initialization: