AppSandboxLoginItemXPCDemo

Last Revision:
Version 1.1, 2012-06-09
Updated to reflect current best practices. Specifically, replaced NSOperationQueue with dispatch_async() and srandomdev() with arc4random().
Build Requirements:
OS X 10.8 or later, Xcode 4.4 or later
Runtime Requirements:
OS X 10.8 or later

This sample project shows how to use NSXPCConnection to communicate between an AppSandboxed app and its associated login item. After launching, the user will get a window with a text input field in which they can enter questions for which a yes/no response is warranted. The application then passes these questions to a login item that responds with an entertaining answer to the question. This sample is intended to demonstrate the mechanics of interprocess communication between AppSandboxed processes.