NSManagedObject subclass files are not generated correctly after prefixing a module name to an entities class name (Swift)

Originator:timroadley
Number:rdar://18563950 Date Originated:21-Oct-2014
Status:Duplicate of 17928508 Resolved:No
Product:Xcode Product Version:6
Classification: Reproducible:Yes
 
According to this article I am now supposed to prefix an entities class name with the application’s module name (Swift):
 
https://developer.apple.com/library/prerelease/mac/documentation/Swift/Conceptual/BuildingCocoaApps/WritingSwiftClassesWithObjective-CBehavior.html
 
If, after doing so, I generate NSManagedObject subclass files, they aren't generated properly. Instead of an NSManagedObject subclass being created for each entity, I get only one NSManagedObject subclass with the same name as the module. From this point I cannot reference my NSManagedObjects with dot notation specific to each entity.

Steps to Reproduce:
1) Create a Core Data app with two entities, each containing a test attribute with any data type.
2) Prefix the class name of each entity with the application's module name.
3) Generate NSManagedObject subclass files for each entity. Only one NSManagedObject subclass will have been created.

Expected Results:
A Swift class file should be generated for each entity.

Actual Results:
A single ModuleName.EntityName swift class is generated instead. 

ModuleName is the name of the module prefix and EntityName is the name of the entity that this class is based on.

Version:
Version 6.0 (6A313)

Notes:
To Fix This Issue:
1) Remove module prefix for each entities class.
2) Generate NSManagedObject subclass files for each entity. Both NSManagedObject subclasses will have been created correctly.
3) Re-add the module prefix

**NOTE: I have noticed also that generating an NSManagedObject subclass will NOT overwrite an existing file of the same name. You must delete existing files of the same name first, so be aware of this with your testing.

Configuration:
This issue happens whenever you're using the Core Data framework with Swift.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!