开发者

Using custom UI views from library in interface builder

开发者 https://www.devze.com 2023-01-15 23:45 出处:网络
I have 2 projects. One is a library that I am compiling to a .a file and the other is the application. The library has a class (AdFactoryView) that extends UIView that is used to display ads. Previous

I have 2 projects. One is a library that I am compiling to a .a file and the other is the application. The library has a class (AdFactoryView) that extends UIView that is used to display ads. Previously I was creating the AdFactoryView programmatically calling initWithFrame, now I'm trying to put the class directly into a nib and use it from there. I can find the class in the interface builder library, add it and link up the reference to an IBOutlet but when the code runs I get a message that says:

Unknown class AdFactoryView in Interface Builder file.

And the IBOutlet contains a UIView instead of an AdFactoryView. How do I g开发者_JAVA百科et the view from my library to work correctly?

Extra information: The application is built by importing the .a and .h files for the library. I have another project that references the entire library project directly that I use for testing, in this project AdFactoryView does not show up in interface builder.

Edit: This suddenly started working in my application project, though I still can't see the custom views in interface builder in my test project.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号