Skip to content

Instantly share code, notes, and snippets.

@indragiek
Created October 22, 2013 01:04
Show Gist options
  • Save indragiek/7093584 to your computer and use it in GitHub Desktop.
Save indragiek/7093584 to your computer and use it in GitHub Desktop.
Core Data interface
typedef void (^FGOConfigurationBlock)(id);
@interface FGOManagedObjectContextStack : NSObject
- (id)initWithModelName:(NSString *)modelName;
- (RACSignal *)save;
#pragma mark - Fetching
- (RACSignal *)fetchImmediatelyWithRequest:(NSFetchRequest *)request;
- (RACSignal *)fetchWithRequest:(NSFetchRequest *)request;
- (RACSignal *)fetchCountWithRequest:(NSFetchRequest *)request;
- (RACSignal *)fetchExistingObjectWithRequest:(NSFetchRequest *)request;
#pragma mark - Insertion
- (id)insertObjectOfEntityName:(NSString *)entityName configure:(FGOConfigurationBlock)block;
- (RACSignal *)fetchOrCreateObjectWithRequest:(NSFetchRequest *)request configure:(FGOConfigurationBlock)block;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment