佳为好友

原:isMemberOfClass在UnitTest失败

创建:2012年10月23日
参照:
http://stackoverflow.com/questions/11675256/ismemberofclass-returns-no-when-viewcontroller-is-instantiated-from-uistoryboard
当在UnitTest时使用isMemberOfClass,会失败。
原因是:在你测试的F.app和test bundle. ocunit里面都包含了该类的实现文件。
解决方法是:将该类的实现文件从测试target中去掉即可。

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.

更为深层次的原因,还没有探究。
+++++

posted on 2012-12-29 10:29 佳为好友 阅读(200) 评论(0)  编辑 收藏 引用 所属分类: 非UI

导航

<2026年1月>
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

留言簿(1)

随笔分类

搜索

最新评论

评论排行榜