5

I create keyboard extension, and in need to get access to CoreData. It works well from container app AppDelegate. But from extension I can't gain access to data. First of all I need instance of NSManagedObjectContext, which I don't have.

So how can I obtain this context by using AppGroup or something else?

By the way, when extension start it print in log next message:

Warning: CFFIXED_USER_HOME is not set!  It should be set to the simulated home directory.
Failed to inherit CoreMedia permissions from 16808: (null)

What can be wrong with it?

Vitaliy L
  • 572
  • 4
  • 20
  • Have you get this fixed? Please let me know asap. – Muzammil Sep 24 '14 at 12:21
  • nope=( i decide avoid using CoreData, because it's to slow for my case. You still can try something like read data in application, write it in AppGroup, like mentioned below, but it's not a solution for this question. – Vitaliy L Sep 25 '14 at 13:46
  • I also did not find any way to get core data in my keyboard extension, only NSUserDefault works. It seems Apple not giving access of Core Data in Keyboard Extension. May be it work for any other extension. – Muzammil Sep 29 '14 at 09:20
  • Check out this thread: [http://stackoverflow.com/questions/26065539/magicalrecord-coredata-today-extension-ios8-will-they-play](http://stackoverflow.com/questions/26065539/magicalrecord-coredata-today-extension-ios8-will-they-play) – user3574332 Jun 10 '16 at 16:33

1 Answers1

1

Follow this tutorial, create an App Group and retrieve data from that group

http://www.glimsoft.com/06/28/ios-8-today-extension-tutorial/

David Ng
  • 470
  • 4
  • 13
  • 2
    This is not working with Keyboard extension (sharing Core Data). Sharing NSUserDefault works fine. – Muzammil Sep 29 '14 at 09:19