-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot apply Mappable Protocol to NSManagedObject Subclass #61
Comments
Hi there, One thing I do notice in the above code is that the Event class doesn't include the initializer. Hope this helps.. |
Hi
|
Any news with that issue? Thanks |
Seems as though not using CocoaPods suse_frameworks directive allows a build I’ve yet to exercise the mapper though
|
I have been easily able to use ObjectMapper with Core Data. #195 for details. |
I'm seeing a very obscure build error with objects inheriting from NSManaged object, the code below is extracted form a sample project based on the MasterDetail template. ObjectMapper is installed via 0.36.0.beta.2 Cocoapods with the _Event and Event classes generated with mogenerator 1.28 --v2 --swift. It makes no difference whether the protocol is applied to the derived Human readable class or the Machine Readable class inherited form NSManagedObject.
This builds OK:
import Foundation
import ObjectMapper
class Lump: Mappable {
var timeStamp : NSDate?
required init() {}
func mapping(map : Map) {
timeStamp <= (map["timeStamp"],DateTransform())
}
}
This does not:
import ObjectMapper
@objc(Event)
class Event: _Event, Mappable {
func mapping(map : Map) {
timeStamp <= (map["timeStamp"],DateTransform())
}
}
The error message is
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
.. snip ..
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
The text was updated successfully, but these errors were encountered: