Skip to content

Instantly share code, notes, and snippets.

@hkalexling
Last active April 19, 2017 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkalexling/1358f9bb2e0708b7bc1ba03daaeb97d0 to your computer and use it in GitHub Desktop.
Save hkalexling/1358f9bb2e0708b7bc1ba03daaeb97d0 to your computer and use it in GitHub Desktop.
static CFDataRef CFMessageHandler(CFMessagePortRef port, SInt32 messageID, CFDataRef data, void *info) {
if (data) {
const UInt8 *msg = CFDataGetBytePtr(data);
NSString *msgStr = [NSString stringWithCString:(char *)msg encoding:NSUTF8StringEncoding];
NSLog(@"received message: %@", msgStr);
}
return CFDataCreate(NULL, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment