kstenerud/iOS-Universal-Framework — Issue #54: +load in Real Framework
Author: pinacate
Created: 2012-03-09 16:09:51+00:00
State: open

+load is not called after updating to Xcode 4.3.

I use the Objective C +load method in categories. The +load methods were being called nicely when using Xcode 4.2.

Thanks for putting this project together its been very helpful!

I was quite pleasantly surprised a few months ago to learn that while the +load methods don't get call when built into a static library (.a file) or a Fake Framework they were called when built into a Real Framework.

I've put together a simple project to demonstrate the issue. The +load code included in the Framework looks like this:

#import "UIView+BMA.h"
#import "LoadableCategory.h"

MAKE_CATEGORIES_LOADABLE(SomeConcreteClass_MyAdditions);

@implementation UIView (BMA)

+ (void)load {
NSLog(@"+load -- UIView_BMA");
}

@end