CoreData property accessors not marked as Optional when generated from Xcode

Originator:saul
Number:rdar://19170943 Date Originated:07-Dec-2014 05:23 PM
Status:Open Resolved:
Product:Developer Tools Product Version:6.2
Classification:Serious Bug Reproducible:Always
 
Summary:
After creating a CoreData model, the next step is to create your entity code using the Xcode provided toolset. When creating the NSManagedObject subclasses in swift, the properties are not marked as Optional using the code generator. The lack of marked optionals results in a crash when any property on an entity is accessed either for reading or writing.

Steps to Reproduce:
(0. Create a new CoreData sample project)
1. Create a new Core Data Managed Object Model, with at 1 entity, and at 1 attribute
2. Set the type of the attribute to String
3. Select the MOM file, in the Xcode menu select Editor > Create NSManagedObject Subclass…
4. Select the entity, set the language to Swift
5. Click Generate/Go/Enter

Expected Results:
The property on the generated attribute to be marked as Optional (?). All CoreData property accessors need to be marked Optional at this time.

Actual Results:
The proper is not marked as Optional.

Regression:


Notes:
Provide additional information, such as references to related problems, workarounds and relevant attachments.

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!