Skip to content

Commit

Permalink
Use @count to get the count of the array
Browse files Browse the repository at this point in the history
  • Loading branch information
danielctull committed Jan 25, 2012
1 parent a228310 commit b2ce79b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/machine.m.motemplate
Expand Up @@ -199,14 +199,14 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
fetchRequest.entity = [NSEntityDescription entityForName:@"<$Relationship.destinationEntity.name$>" inManagedObjectContext:self.managedObjectContext];
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"<$Relationship.inverseRelationship.name$> <$if Relationship.inverseRelationship.isToMany$>CONTAINS<$else$>==<$endif$> %@", self];
fetchRequest.sortDescriptors = sortDescriptors;
<$if indexedNoninheritedAttributes.count > 0$>
<$if indexedNoninheritedAttributes.@count > 0$>
NSArray *indexedIDs = [NSArray arrayWithObjects:<$foreach Attribute indexedNoninheritedAttributes do$>self.<$Attribute.name$>, <$endforeach do$>nil];
NSString *cacheName = [NSString stringWithFormat:@"mogenerator.<$managedObjectClassName$>.%@.<$Relationship.name$>.%@", indexedIDs, sortDescriptors];
<$endif$>
return [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
managedObjectContext:self.managedObjectContext
sectionNameKeyPath:nil
cacheName:<$if indexedNoninheritedAttributes.count > 0$>cacheName<$else$>nil<$endif$>];
cacheName:<$if indexedNoninheritedAttributes.@count > 0$>cacheName<$else$>nil<$endif$>];
}
<$endif$>
<$endforeach do$>
Expand Down

0 comments on commit b2ce79b

Please sign in to comment.