Swift dynamic cast failed - Error when trying to run unit tests

前端 未结 1 670
天涯浪人
天涯浪人 2020-12-06 13:52

Xcode Version 6.1.1 (6A2008a)

Error: libswiftCore.dylib`swift_dynamicCastClassUnconditional and Swift dynamic cast failed

I am trying to test and I am comin

相关标签:
1条回答
  • 2020-12-06 14:26

    Ok so after a lot of messing about here is what solved the issue:

    1. I removed all the test target membership from the files in the main (non-test) part of my application, including the AppDelegate.

    enter image description here

    1. I changed all the classes (in the main part of the application) that I needed to access (from the Test part of the application) to be public and also set these class's required methods to be public as well).

    2. I imported the main project into each appropriate test classes with an #import AppName statement

    Hope that saves some other people some time.. :)

    0 讨论(0)
提交回复
热议问题