Unknown class in Interface Builder file

Interface Builder找Class的机制和一般的源文件相同,需要保证包含目标symbol的文件被链接进到最终的app。

出现这个错误,是因为这个class只在IB中用到,编译器在其他源文件中没有发现对这个class的引用,于是没有链接那个class。

解决方法:
1. 在任意一个源文件中使用一下这个class,比如NSLog(@”%@”, classA);
2. 在project的Info里面的Link Flag处,增加-all_load,这样会链接所以存在的symbol

2 Comments

Add a Comment

Your email address will not be published. Required fields are marked *