-
Notifications
You must be signed in to change notification settings - Fork 194
.create() call broken in Swift as of Swift 1.2 (xcode 6.3-beta) #115
Comments
This could be solved by inspecting the result of + (NSString *)entityName {
NSString *entityName = NSStringFromClass(self);
if ([entityName containsString:@"."]) {
NSArray *components = [entityName componentsSeparatedByString:@"."];
if (components.count > 1) entityName = components.lastObject;
}
return entityName;
} |
My work around was to override entityName in a subclass. On Thursday, February 19, 2015, Bart Jacobs notifications@github.com
|
I've been struggling with class names in my frameworks as well, here's the solution i came up with: This is basically NSStringFromClass, but language-independent, which returns class name in objective-c, and second part of class name in Swift(first is module name). |
I use Swift 1.2 and XCode 6.3 and I'm still getting the Any ideas where I failed? Here's what fails and my steps:
I managed to get such error: |
Just popped a swift version. |
The
create()
call fails because, increateInContext:
the call to[self entityName]
returns'ModuleName.Classname"
instead of just"Classname"
as it did in Obj-c. The format of the return type ofNSStringFromClass
changed in the latest Swift release.The text was updated successfully, but these errors were encountered: