Permalink
Browse files

Added missing NSOrderedSet methods (insert, remove, replace, etc) per…

… Issue #75 comments.
  • Loading branch information...
1 parent e8a05a3 commit 13a363000a7820179e9bd340ec0f35aad1a9d4a2 @JRG-Developer committed Nov 19, 2013
Showing with 33 additions and 2 deletions.
  1. +15 −2 templates/machine.h.motemplate
  2. +18 −0 templates/machine.m.motemplate
View
17 templates/machine.h.motemplate
@@ -115,14 +115,27 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
<$endif$>
@end
-<$foreach Relationship noninheritedRelationships do$><$if Relationship.isToMany$>
+<$foreach Relationship noninheritedRelationships do$>
+<$if Relationship.isToMany$>
@interface _<$managedObjectClassName$> (<$Relationship.name.initialCapitalString$>CoreDataGeneratedAccessors)
- (void)add<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$>*)value_;
- (void)remove<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$>*)value_;
- (void)add<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_;
- (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_;
+
+<$if Relationship.isOrdered$>
+- (void)insertObject:(<$Relationship.immutableCollectionClassName$>*)value in<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx;
+- (void)removeObjectFrom<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx;
+- (void)insert<$Relationship.name.initialCapitalString$>:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
+- (void)remove<$Relationship.name.initialCapitalString$>AtIndexes:(NSIndexSet *)indexes;
+- (void)replaceObjectIn<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx withObject:(<$Relationship.immutableCollectionClassName$>*)value;
+- (void)replace<$Relationship.name.initialCapitalString$>AtIndexes:(NSIndexSet *)indexes with<$Relationship.name.initialCapitalString$>:(NSArray *)values;
+<$endif$>
+
@end
-<$endif$><$endforeach do$>
+<$endif$>
+
+<$endforeach do$>
@interface _<$managedObjectClassName$> (CoreDataGeneratedPrimitiveAccessors)
<$foreach Attribute noninheritedAttributesSansType do$>
View
18 templates/machine.m.motemplate
@@ -243,6 +243,24 @@ const struct <$managedObjectClassName$>UserInfo <$managedObjectClassName$>UserIn
- (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$>*)value_ {
[self.<$Relationship.name$>Set removeObject:value_];
}
+- (void)insertObject:(<$Relationship.immutableCollectionClassName$>*)value in<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx {
+ [self.<$Relationship.name$>Set insertObject:value atIndex:idx];
+}
+- (void)removeObjectFrom<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx {
+ [self.<$Relationship.name$>Set removeObjectAtIndex:idx];
+}
+- (void)insert<$Relationship.name.initialCapitalString$>:(NSArray *)value atIndexes:(NSIndexSet *)indexes {
+ [self.<$Relationship.name$>Set insertObjects:value atIndexes:indexes];
+}
+- (void)remove<$Relationship.name.initialCapitalString$>AtIndexes:(NSIndexSet *)indexes {
+ [self.<$Relationship.name$>Set removeObjectsAtIndexes:indexes];
+}
+- (void)replaceObjectIn<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx withObject:(<$Relationship.immutableCollectionClassName$>*)value {
+ [self.<$Relationship.name$>Set replaceObjectAtIndex:idx withObject:value];
+}
+- (void)replace<$Relationship.name.initialCapitalString$>AtIndexes:(NSIndexSet *)indexes with<$Relationship.name.initialCapitalString$>:(NSArray *)value {
+ [self.<$Relationship.name$>Set replaceObjectsAtIndexes:indexes withObjects:value];
+}
@end
<$endif$><$endif$><$endforeach do$>

0 comments on commit 13a3630

Please sign in to comment.