Created
May 1, 2013 12:39
-
-
Save alesleoignis/5495079 to your computer and use it in GitHub Desktop.
CLIENT-SERVER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//client | |
NSProxy *proxy = [NSConnection rootProxyForConnectionWithRegisteredName:@"ALIConnection" host:nil]; | |
id reply = [proxy request:@"request"]; | |
NSLog(@"%@", reply); | |
// | |
//server | |
+ (void)start { | |
NSConnection *connection = [NSConnection defaultConnection]; | |
[connection setRootObject:self]; | |
[connection registerName:@"ALIConnection"]; | |
} | |
+ (NSString *) request:(NSString *)request { | |
NSLog(@"%@", request); | |
return request; | |
} | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment