isMemberOfClass returns no when ViewController is instantiated from UIStoryboard

后端 未结 2 2038
长情又很酷
长情又很酷 2020-12-01 20:35

I have an OCUnit Test class: PatientTestViewControllerTests. Below is the interface:

@interface PatientTestViewControllerTests : SenTestCase

@property (nona         


        
2条回答
  •  情话喂你
    2020-12-01 20:46

    The problem is likely that your view controller's .m file is included in both targets, the app and the test bundle. ocunit (and derivatives like Kiwi) uses a test harness that makes the classes included in the app available to tests without having to explicitly include their implementation.

    Including both has given you two copies of the same class, which is why they have the same description but different memory addresses.

提交回复
热议问题