Skip to content

Commit

Permalink
Specifically suppress setPrimitiveType: generation -- apparently it t…
Browse files Browse the repository at this point in the history
…riggers Apple's piss-poor private-API-use detector when submitting to the App Store. Closes rentzsch#16.
  • Loading branch information
rentzsch committed Jan 14, 2013
1 parent 6a6a019 commit eb8ba53
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions mogenerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ - (NSArray*)noninheritedAttributes {
}
}
/** @TypeInfo NSAttributeDescription */
- (NSArray*)noninheritedAttributesSansType {
NSArray *attributeDescriptions = [self noninheritedAttributes];
NSMutableArray *filteredAttributeDescriptions = [NSMutableArray arrayWithCapacity:[attributeDescriptions count]];

nsenumerate(attributeDescriptions, NSAttributeDescription, attributeDescription) {
if (![[attributeDescription name] isEqualToString:@"type"]) {
[filteredAttributeDescriptions addObject:attributeDescription];
}
}
return filteredAttributeDescriptions;
}
/** @TypeInfo NSAttributeDescription */
- (NSArray*)noninheritedRelationships {
NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]];
NSEntityDescription *superentity = [self superentity];
Expand Down
2 changes: 1 addition & 1 deletion templates/machine.h.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
<$endif$><$endforeach do$>

@interface _<$managedObjectClassName$> (CoreDataGeneratedPrimitiveAccessors)
<$foreach Attribute noninheritedAttributes do$>
<$foreach Attribute noninheritedAttributesSansType do$>
<$if Attribute.hasDefinedAttributeType$>
- (<$Attribute.objectAttributeType$>)primitive<$Attribute.name.initialCapitalString$>;
- (void)setPrimitive<$Attribute.name.initialCapitalString$>:(<$Attribute.objectAttributeType$>)value;
Expand Down
Binary file modified test/test.xcdatamodel/elements
Binary file not shown.
Binary file modified test/test.xcdatamodel/layout
Binary file not shown.

0 comments on commit eb8ba53

Please sign in to comment.