Override a static library's global function
Posted
by
Jason Madux
on Programmers
See other posts from Programmers
or by Jason Madux
Published on 2014-06-08T18:08:18Z
Indexed on
2014/06/08
21:39 UTC
Read the original article
Hit count: 228
Not sure if this question belongs here or on SO, but posting here for now :)
I'm trying to override a global function defined in "StaticLib" for my iOS application but the compiler keeps giving me the duplicate symbol error.
Relevant code:
#import "MyApplication.h"
#import "StaticLib.h"
NSData* getAllData() {
NSLog(@"myGetAllData");
return nil;
}
@implementation MyApplication
...
@end
I've looked into Apple's runtime library but that all seems to be class-oriented. Any suggestions or is it just not possible to override global functions from static libraries?
© Programmers or respective owner