Skip to content

Instantly share code, notes, and snippets.

@matzew
Last active December 10, 2015 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/f5a4dd82ad628eb35980 to your computer and use it in GitHub Desktop.
Save matzew/f5a4dd82ad628eb35980 to your computer and use it in GitHub Desktop.
- (void)viewDidLoad {
[super viewDidLoad];
...
NSFetchRequest *myFetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *myEntity = [NSEntityDescription entityForName:@"Tag"
inManagedObjectContext:aerogearPlugin.managedObjectContext];
[myFetchRequest setEntity:myEntity];
NSError *error = nil;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(remoteObjectFetched:)
name:AFIncrementalStoreContextDidFetchRemoteValues
object:aerogearPlugin.managedObjectContext];
[aerogearPlugin.managedObjectContext executeFetchRequest:myFetchRequest error:&error];
}
- (void) remoteObjectFetched:(NSNotification*)notification {
NSDictionary *userInfo = [notification userInfo];
NSArray *fetchedObjects = [userInfo objectForKey:AFIncrementalStoreFetchedObjectsKey];
}
@matzew
Copy link
Author

matzew commented Dec 31, 2012

The CoreData NSManagedObjectContext will be received from the AeroGear plugin class... (aerogearPlugin.managedObjectContext).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment