Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aligning all pointer stars #103

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions templates/machine.h.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
<$if TemplateVar.arc$>
@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$>* <$Relationship.name$>;
@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
<$else$>
@property (nonatomic, retain) <$Relationship.immutableCollectionClassName$>* <$Relationship.name$>;
@property (nonatomic, retain) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
<$endif$>
- (<$Relationship.mutableCollectionClassName$>*)<$Relationship.name$>Set;
<$else$>
<$if TemplateVar.arc$>
@property (nonatomic, strong) <$Relationship.destinationEntity.managedObjectClassName$>* <$Relationship.name$>;
@property (nonatomic, strong) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
<$else$>
@property (nonatomic, retain) <$Relationship.destinationEntity.managedObjectClassName$>* <$Relationship.name$>;
@property (nonatomic, retain) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
<$endif$>
//- (BOOL)validate<$Relationship.name.initialCapitalString$>:(id*)value_ error:(NSError**)error_;
<$endif$>
Expand All @@ -77,7 +77,7 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors;
- (NSFetchedResultsController*)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray*)sortDescriptors;
<$endif$>
<$endforeach do$>
#endif
Expand Down
18 changes: 9 additions & 9 deletions templates/machine.m.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
return (<$managedObjectClassName$>ID*)[super objectID];
}

+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasDefinedAttributeType$><$if Attribute.hasScalarAttributeType$>
if ([key isEqualToString:@"<$Attribute.name$>Value"]) {
Expand Down Expand Up @@ -115,7 +115,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
+ (id)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;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];
<$if FetchRequest.hasBindings$>
NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:
Expand All @@ -129,10 +129,10 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"<$FetchRequest.name$>"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"<$FetchRequest.name$>\".");

id result = nil;
NSArray *results = [moc_ executeFetchRequest:fetchRequest error:&error];

if (!error) {
switch ([results count]) {
case 0:
Expand All @@ -148,7 +148,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
results);
}
}

if (error_) *error_ = error;
return result;
}
Expand All @@ -168,7 +168,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
+ (NSArray*)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;

NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];
<$if FetchRequest.hasBindings$>
NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:
Expand All @@ -178,11 +178,11 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
nil];
<$else$>
NSDictionary *substitutionVariables = [NSDictionary dictionary];
<$endif$>
<$endif$>
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"<$FetchRequest.name$>"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"<$FetchRequest.name$>\".");

NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
if (error_) *error_ = error;
return result;
Expand All @@ -193,7 +193,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors {
- (NSFetchedResultsController*)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray*)sortDescriptors {
NSFetchRequest *fetchRequest = [NSFetchRequest new];
<$if !TemplateVar.arc$>[fetchRequest autorelease];<$endif$>
fetchRequest.entity = [NSEntityDescription entityForName:@"<$Relationship.destinationEntity.name$>" inManagedObjectContext:self.managedObjectContext];
Expand Down