Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Created August 2, 2011 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kballenegger/1121324 to your computer and use it in GitHub Desktop.
Save kballenegger/1121324 to your computer and use it in GitHub Desktop.
Forcing category linking in static libraries.
// [...]
#import "NSInvocation+ForwardedConstruction.h"
void linkToMyCategoryProperly(void);
void linkToMyCategoryProperly() {
emptyCFunctionToForceLinkerToIncludeNSInvocationForwardedConstruction(); // make sure it's linked to properly
}
// [...]
// [...]
void emptyCFunctionToForceLinkerToIncludeNSInvocationForwardedConstruction(void);
// [...]
// [...]
void emptyCFunctionToForceLinkerToIncludeNSInvocationForwardedConstruction() {
// do nothing
}
// [...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment