Commit 05cc85b4 by Brent Gulanowski

Support default initializer and rename method to be less ambiguous.

parent 8472edab
......@@ -40,15 +40,13 @@
*/
@property (nonatomic, strong, readonly) NSManagedObjectModel *model;
- (instancetype)init NS_UNAVAILABLE;
/**
*
* @param model The Core Data managed object model for your given model. Should be the Buy model.
*
* @return A new model manager object.
*/
- (instancetype)initWithModel:(NSManagedObjectModel *)model NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithManagedObjectModel:(NSManagedObjectModel *)model NS_DESIGNATED_INITIALIZER;
/**
* Convenience initializer. Instantiates a model using the -mergedModelFromBundles: method and the Buy.framework as the bundle.
......
......@@ -64,7 +64,12 @@ NSString * const BUYPublicationsDateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ";
});
}
- (instancetype)initWithModel:(NSManagedObjectModel *)model
- (instancetype)init
{
return [self initWithManagedObjectModel:[NSManagedObjectModel mergedModelFromBundles:@[[NSBundle bundleForClass:[self class]]]]];
}
- (instancetype)initWithManagedObjectModel:(NSManagedObjectModel *)model
{
self = [super init];
if (self) {
......@@ -75,7 +80,7 @@ NSString * const BUYPublicationsDateFormat = @"yyyy-MM-dd'T'HH:mm:ssZ";
+ (instancetype)modelManager
{
return [[self alloc] initWithModel:[NSManagedObjectModel mergedModelFromBundles:@[[NSBundle bundleForClass:[BUYObject class]]]]];
return [[self alloc] init];
}
- (NSEntityDescription *)buy_entityWithName:(NSString *)entityName
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment