[Core Data, Swift] Creating NSManagedObject subclasses should include @objc

Originator:wirth_caesar
Number:rdar://18780267 Date Originated:27-Oct-2014
Status:Duplicate of 17850922 (Closed) Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Summary:
Auto-generating an NSManagedObject subclass in Swift does a pretty good job.
However, if you try to use the objects as-is (like in a simple fetch), it will cause an exception because it cannot find the entity with the name.

This is always fixed by putting @objc(MyClass) above the class delcaration, such as:

@objc(BlogPost)
class BlogPost: NSManagedObject {
...
}

It would be nice if these could be generated automatically, and I wouldn't be surprised with a crash every time I change my data model :)

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!