I’ve seen this sort of thing when properties do not have their nullability set correctly. In this case
entityis declared as never being nil, but it sounds like it is. Alas, the documentation doesn’t shed any light on why this might happen. I recommend two things:
Confirm that this is, in fact, the problem. You can do this by adding an Objective-C category that declares a a new property,
maybeEntityperhaps, that is optional. Then have the Objective-C method implementation just return the
entityproperty. At that point your Swift code can access
maybeEntityand determine if it is indeed nil.
Once you’ve confirmed the problem, you might ask over in App Frameworks > Core Data to see if anyone can input as to why it might be happening.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"