Files
SnakeAppleSecurityFiles/X. NU/custom/mach_ipc/client_server_NSConnection/server.m
T
2024-12-16 14:12:52 +01:00

23 lines
579 B
Objective-C

#import <Foundation/Foundation.h>
@interface MessageServer : NSObject
- (void)handleMessage:(NSString *)message;
@end
@implementation MessageServer
- (void)handleMessage:(NSString *)message {
NSLog(@"Received: %@", message);
}
@end
int main() {
@autoreleasepool {
MessageServer *server = [[MessageServer alloc] init];
NSConnection *connection = [NSConnection defaultConnection];
[connection setRootObject:server];
[connection registerName:@"com.crimson.message_service"];
[[NSRunLoop currentRunLoop] run];
}
return 0;
}