mirror of
https://github.com/Karmaz95/Snake_Apple.git
synced 2026-06-02 17:41:35 +02:00
23 lines
579 B
Objective-C
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;
|
|
}
|