Any chance of getting rid of the all_load requirement for the iOS framework?

来源:互联网 发布:中国人审美标准知乎 编辑:程序博客网 时间:2024/05/19 23:13

The fix is basically: 

/** 
 * Add this macro to the end of each category addition implementation, so we don't have to use -all_load 
 * or -force_load to load object files from static libraries that only contain categories and no classes. 
 * See http://developer.apple.com/library/mac/#qa/qa2006/qa1490.html for more info. 
 */ 
#define TT_FIX_CATEGORY_BUG(name) 

@interface TT_FIX_CATEGORY_BUG_##name 

@end 


@implementation TT_FIX_CATEGORY_BUG_##name 

@end 


Then the macro is added to each category. 

Hopefully, this info can point you in the right direction. 

On Aug 16, 2011, at 5:00 PM, Derek Smith wrote: 

> Hi Eric, 

> This would mean that we would have to remove all of the ObjC categories from the code-base. This is entirely possible but it will take some time to accomplish. Just thinking off the top of my head, there is probably a way to declare a pre-processor macro that can handle this type of situation. I'll do some trial-and-error and get back to you once I have a patch for your problem. 

原创粉丝点击