lundi 25 avril 2016

swift core data wrong namespace on ManagedObject in unit test

I have a mixed language project. I have started to use Swift for the generated Core Data entities. Running into issues with unit testing. I am trying to create an instance of one of my entities, and getting some sort of namespace issue.

Here is the message I am getting when I am trying to assign it to a variable.

Could not cast value of type 'ExpenseManager.ExpenseItem' (0x7fae51f4ff40) to 'ExpenseManagerTests.ExpenseItem' (0x115e109e0).

The type of the entity coming back from CoreData is correct - but for some reason within my unit test, it thinks it needs to convert to the namespace of my unit test target.

Not getting this issue with entities that are still rendered as Objective-C. Only this class, ExpenseItem, which is in Swift.

Any ideas on what I should look at to resolve?

Aucun commentaire:

Enregistrer un commentaire