From 3a71d4682c66b81b75837f042b2bf1f97292af9a Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Thu, 7 Aug 2014 16:48:01 +0100 Subject: [PATCH] Fix object type in replaceObjectInFooAtIndex:withObject: The generated .m files should use the object class in - (void)replaceObjectInFoosAtIndex:(NSUInteger)idx withObject:(Foo*)value rather than the collection class (eg - (void)replaceObjectInFoosAtIndex:(NSUInteger)idx withObject:(NSOrderedSet*)value) --- templates/machine.m.motemplate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index 4a038b72..6e974ea5 100644 --- a/templates/machine.m.motemplate +++ b/templates/machine.m.motemplate @@ -273,7 +273,7 @@ const struct <$managedObjectClassName$>UserInfo <$managedObjectClassName$>UserIn [self setPrimitiveValue:tmpOrderedSet forKey:@"<$Relationship.name$>"]; [self didChange:NSKeyValueChangeRemoval valuesAtIndexes:indexes forKey:@"<$Relationship.name$>"]; } -- (void)replaceObjectIn<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx withObject:(<$Relationship.immutableCollectionClassName$>*)value { +- (void)replaceObjectIn<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx withObject:(<$Relationship.destinationEntity.managedObjectClassName$>*)value { NSIndexSet* indexes = [NSIndexSet indexSetWithIndex:idx]; [self willChange:NSKeyValueChangeReplacement valuesAtIndexes:indexes forKey:@"<$Relationship.name$>"]; NSMutableOrderedSet *tmpOrderedSet = [NSMutableOrderedSet orderedSetWithOrderedSet:[self <$Relationship.name$>]];