Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to obtain NSManagedObjectContext instance from Extension iOS 8

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?

like image 257
Vitaliy L Avatar asked Nov 11 '22 04:11

Vitaliy L


1 Answers

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

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

like image 168
David Ng Avatar answered Dec 21 '22 06:12

David Ng