Closed hopiaw closed 9 years ago
Hi,
I reach the point where one of my swift class is calling the following:
self.mapper.objectFromSource(JSON, toInstanceOfClass:MySwiftClass.self)
In the method of class ManagedObjectInstanceProvider:
- (id)emptyInstanceForClass:(Class)class
the call to:
[NSEntityDescription entityForName:NSStringFromClass(class) inManagedObjectContext:self.managedObjectContext];
will always return nil cause the result of NSStringFromClass(class) will be something like:
"ProjectName.ClassName"
In Objective C, the above method will return an entityDescription if the entityForName parameter is "ClassName".
Do you have an idea on how I can make that call working?
Thanks.
My bad, I miss that @objc declaration in my class.
Cool Will add some Swift tests/samples to the project soon
Hi,
I reach the point where one of my swift class is calling the following:
In the method of class ManagedObjectInstanceProvider:
the call to:
will always return nil cause the result of NSStringFromClass(class) will be something like:
"ProjectName.ClassName"
In Objective C, the above method will return an entityDescription if the entityForName parameter is "ClassName".
Do you have an idea on how I can make that call working?
Thanks.