2023-06-07 10:49:59 +07:00
|
|
|
#import <Foundation/Foundation.h>
|
2023-06-21 17:28:42 +07:00
|
|
|
#include <stdio.h>
|
2023-06-07 10:49:59 +07:00
|
|
|
|
2023-06-15 10:46:10 +07:00
|
|
|
@interface Foo : NSObject
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Foo
|
|
|
|
- (void)bar {
|
|
|
|
NSLog(@"%@", self);
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Bar : NSObject
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Bar
|
|
|
|
+ (void)load {
|
|
|
|
NSLog(@"%@", self);
|
2023-06-21 17:28:42 +07:00
|
|
|
printf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n");
|
2023-06-15 10:46:10 +07:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2023-06-21 17:28:42 +07:00
|
|
|
// @implementation Baz : Bar
|
|
|
|
// @end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__attribute__((constructor)) static void
|
|
|
|
hmmge() {
|
|
|
|
// create a dummy blank function to be replaced to call OBJC load
|
|
|
|
printf("hmmge\n");
|
|
|
|
}
|
2023-06-15 10:46:10 +07:00
|
|
|
|
2023-06-07 10:49:59 +07:00
|
|
|
int main(int argc, const char * argv[]) {
|
2023-06-15 10:46:10 +07:00
|
|
|
@autoreleasepool {
|
|
|
|
NSLog(@"Hello, World!");
|
|
|
|
Foo *foo = [[Foo alloc] init];
|
|
|
|
[foo bar];
|
|
|
|
}
|
|
|
|
return 0;
|
2023-06-07 10:49:59 +07:00
|
|
|
}
|