Xcode 4, Interface Builder and the Awareness of Classes in a Static Library

佐手、 提交于 2019-12-03 12:36:42

I had a similar issue and solved it by declaring a category on the class I wished included in the project. This forced the class to be loaded from the static library. There wasn't any actual methods defined in the class.

There are some other alternatives that are commonly bandied about like setting linker flags -ObjC and -all_load

** update in response to request for code.

I added a Group to the project named "Categories to force class loads" and, for example, to force the "SimpleAppStateManager" class to be included in this project (that was defined in the shared static library) added these 'empty' category files:

SimpleAppStateManager+DART.h

#import <Foundation/Foundation.h>
#import "SimpleAppStateManager.h"

@interface SimpleAppStateManager (DART)
@end

SimpleAppStateManager+DART.m

#import "SimpleAppStateManager+DART.h"

@implementation SimpleAppStateManager (DART)
@end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!