I have an NSManagedObject. When I create an instance, it unexpectedly calls the isKindOfClass method.
NSEntityDescription *entity = [NSEntityDescription entityForName:@"DayModel" inManagedObjectContext:context]; DayModel *day = [[DayModel alloc] initWithEntity:entity insertIntoManagedObjectContext:context]; if ([day isKindOfClass:[DayModel class]]) { NSLog(@"True"); } else { NSLog(@"False"); }
Exit:
False
I added the following code:
Class objectClass = [day class]; Class classClass = [DayModel class];
And looking at it in the debugger, this is what I found:

Description print classClass prints "DayModel."
I'm not sure if this is relevant, but DayModel is implemented in Swift.
UPDATE
This does not work in my test class, but not in the iOS app. This problem seems similar to this problem . However, I have added all the classes that I can use for the test purpose, and still do not work.
source share