diff --git a/templates/machine.h.motemplate b/templates/machine.h.motemplate index 9fcc4f18..263194ef 100644 --- a/templates/machine.h.motemplate +++ b/templates/machine.h.motemplate @@ -53,8 +53,8 @@ * <$userInfo.discussion$> */ <$endif$> -@interface _<$managedObjectClassName$> : <$customSuperentity$> {} -+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_; +@interface _<$managedObjectClassName$> : <$customSuperentity$> ++ (instancetype)insertInManagedObjectContext:(NSManagedObjectContext *)moc_; + (NSString*)entityName; + (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_; @property (nonatomic, readonly, strong) <$managedObjectClassName$>ID* objectID; @@ -104,8 +104,8 @@ <$endforeach do$> <$foreach FetchRequest prettyFetchRequests do$> <$if FetchRequest.singleResult$> -+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>; -+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_; ++ (instancetype)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>; ++ (instancetype)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_; <$else$> + (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>; + (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_; diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index ff756199..ea77eef6 100644 --- a/templates/machine.m.motemplate +++ b/templates/machine.m.motemplate @@ -40,7 +40,7 @@ @implementation _<$managedObjectClassName$> -+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ { ++ (instancetype)insertInManagedObjectContext:(NSManagedObjectContext *)moc_ { NSParameterAssert(moc_); return [NSEntityDescription insertNewObjectForEntityForName:@"<$name$>" inManagedObjectContext:moc_]; } @@ -125,7 +125,7 @@ <$foreach FetchRequest prettyFetchRequests do$> <$if FetchRequest.singleResult$> -+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>{ ++ (instancetype)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>{ NSError *error = nil; id result = [self fetch<$FetchRequest.name.initialCapitalString$>:moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:<$Binding.name$>_ <$endforeach do2$>error:&error]; if (error) { @@ -137,7 +137,7 @@ } return result; } -+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_ { ++ (instancetype)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_ { NSParameterAssert(moc_); NSError *error = nil;