Closed erndev closed 9 years ago
Ensembles simply monitors the did-save notifications, so it will only work in the process where the save is made.
You could setup Ensembles in both the app and the extension. Even though they would be sharing the same store, I think that would all still work. And that way, it would capture all the saves.
How exactly do you handle saves from the extension? Your app context would need refreshing. Do you reset and reload the data? Or do you somehow pass back the updated objects from the extension to the app?
I somehow thought that i would need to do all the setup steps (including leeching) in the extension. But i did not think about only setting up the ensemble without leeching just to insert the new object. i'll give it a try and see if i does works.
about refreshing the data, not sure about that yet, but my first option is to send some kind of "refresh" command via the host app's url scheme. In my particular use case, i would only need to reload a table view to make the new item visible.
thanks
You would need to leech, because otherwise Ensembles will not register the change.
It does seem that if you are just creating one item in your extension, using Ensembles, or even Core Data, is probably overkill. I would just create a dictionary, and pass that back somehow, and import it in your main app.
Drew
On 21 Dec 2014, at 12:17, Ernesto García notifications@github.com wrote:
I somehow thought that i would need to do all the setup steps (including leeching) in the extension. But i did not think about only setting up the ensemble without leeching just to insert the new object. i'll give it a try and see if i does works.
about refreshing the data, not sure about that yet, but my first option is to send some kind of "refresh" command via the host app's url scheme. In my particular use case, i would only need to reload a table view to make the new item visible.
thanks
— Reply to this email directly or view it on GitHub https://github.com/drewmccormack/ensembles/issues/195#issuecomment-67767153.
On 21 Dec 2014, at 12:22, Drew McCormack drewmccormack@mac.com wrote:
You would need to leech, because otherwise Ensembles will not register the change.
It does seem that if you are just creating one item in your extension, using Ensembles, or even Core Data, is probably overkill. I would just create a dictionary, and pass that back somehow, and import it in your main app.
Drew
On 21 Dec 2014, at 12:17, Ernesto García <notifications@github.com mailto:notifications@github.com> wrote:
I somehow thought that i would need to do all the setup steps (including leeching) in the extension. But i did not think about only setting up the ensemble without leeching just to insert the new object. i'll give it a try and see if i does works.
about refreshing the data, not sure about that yet, but my first option is to send some kind of "refresh" command via the host app's url scheme. In my particular use case, i would only need to reload a table view to make the new item visible.
thanks
— Reply to this email directly or view it on GitHub https://github.com/drewmccormack/ensembles/issues/195#issuecomment-67767153.
In Yosemite and iOS 8, we can now create extensions, which can share the app's core data store. For instance, and extension could create or modify an entity in the same core data store the app is using.
would this work with ensembles? AFAIK, it monitors the changes in the app's context, but i am not sure if it could detect changes done in the same store by an external process (the extension in this case).
Thanks