Interface Builder can't see classes in a static library

前端 未结 4 813
甜味超标
甜味超标 2020-12-28 19:31

I have refactored some UIView sub-classes into a static library. However, when using Interface Builder to create view components for a project that uses the static library I

4条回答
  •  梦毁少年i
    2020-12-28 20:27

    I had the same problem. Dragging the library or headers to XIB Browser didn't work. Read Class Files didn't work. So I called:

    [MyLibraryClass version];    // Substitute your class name for "MyLibraryClass".
    

    This worked. version is a class method of NSObject, so all subclasses of NSObject inherit it.

提交回复
热议问题