I'm using ObjectiveRecord library. There's no problem when use this with Objective-C. But when I use with Swift, maybe it's new to some one, there's problem when I want to create a record to database.
I use Birdging-Header.h with code as below
#import "ObjectiveRecord.h"
When I call as below
var category:Category = Category.create()
category.pkId = 1
category.title = "This is a sample"
At the first line the is error "Ambigious reference to member 'create'".
Is there anyone experience with this error. Please give me advice! Thanks a lot !
Edited:
Detail of Category class
class Category: NSManagedObject {
var pkId: NSInteger?
var title: NSString?
var img: NSString?
}
This is Category class.
Edited:
I resolved the problem above, but now I'm facing another problem. This is how to resolve the above
let category:Category = Category.create() as! Category
Now it throw error as below
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an entity named 'Shopping.Category' in this model.'
Is there anyone know how to solve this ?