I have a Swift project - ObjectiveC / C ++, everything works fine until I add CoreData, now every time I change something, it causes an error:
/.../DerivedData/.../Intermediates/.build/Debug-iphonesimulator/.build/DerivedSources/-Swift.h: 136: 26: Unable to find the interface declaration for "NSManagedObject", superclass "'; You had mean "NSManagedObjectModel"?
and
/.../DerivedData/.../Intermediates/.build/Debug-iphonesimulator/.build/DerivedSources/-Swift.h: 136: 26: Attempting to use the direct class' NSManagedObjectModel 'as a superclass'
Of course, this is not a real problem, I already tried to delete everything on DerivedData, and the problem persists.
Correction, adding -Swift.h, #import to the headers of the file, and then the errors disappeared. Until I change my code.
Does anyone know a real solution for this? its annoying to have to include this lib every time I compile.
Xcode Version: Version 6.3.2 (6D2105)
Edit: The problem occurs in the * -Swift.h file that Xcode creates ...
Edit2: I had to rewrite the whole class to avoid using ObjectiveC (with the exception of third-party libraries), and the problem disappeared, so I think this is due to the way ObjectiveC tries to process Swift-based data classes.
Now I do not have this problem, but someone can someday help
source share