• Stars
    star
    251
  • Rank 161,862 (Top 4 %)
  • Language
    Objective-C
  • Created over 13 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

XPC simplified for Cocoa. Deal with NS* objects instead of xpc_object_t.

XPCKit is a Cocoa library for wrapping the XPC C APIs in a handy object-oriented model. It is merely meant as an object-oriented wrapper for the C library, and does not attempt to layer any additional semantics on top. It contains code to run both "clients" (which create connections to services) and "services" (which receive connections), although you can mix and match to write raw C code or Objective-C code between different clients and services.

Features

  • Simplified Objective-C API for interacting with XPC processes
  • Auto-boxing and auto-unboxing of objects from xpc_object_t objects to:
  • NSArray
  • NSDictionary
  • NSData
  • NSString
  • NSDate
  • NSNumber for bool, UInt64, Int64, and double types
  • NSFileHandle
  • UUIDs (via a custom XPCUUID class)
  • Block-based callbacks
  • Probably safe to use from multiple threads

Wish List

  • Auto-boxing and auto-unboxing for
  • NSData, backed by shared memory (some code for this exists but it is not reliable, causes crashes, doesn't return consistent data, etc.)
  • IOSurfaceRef
  • XPCConnection
  • Compatibility mode for iOS/Snow Leopard
  • Both client and service code lives within the app
  • A mapping of service names to their classes would be added by the developer to the app's Info.plist
  • Objects would be passed through XPCConnection to an XPCService that is contained within the same process
  • No xpc_* types would be available

Authors

Sample Code

Given this sample data, converted to an NSDictionary, you can see how:

  • the client sends this command as a message, and
  • the service receives this command, processes it, and sends the response back

Installation

You can use XPCKit in the client, service, or both; you just have to include the code. You can include XPCKit in one of three ways:

  1. Include the source files yourself (everything in XPCKit)
  2. Make a dependency of XPCKit's framework
  3. Make a dependency of XPCKit's static library (note: you will need to add linker flags -all_load and -ObjC to make this work properly)

Setting up the Client

  1. In your app, add the XPCKit source files, library or framework
  2. Set up an XPCConnection object with the name of your service
  3. Send it a message

Setting up the Service

  1. If you haven't already, create a new "XPC Service" target (located in Mac OS X > Framework & Library)
  2. Add the XPCKit source files, library or framework
  3. Link against the Foundation framework
  4. Rename "main.c" to "main.m"
  5. In your main function, call +[XPCService runServiceWithConnectionHandler:] to start listening for incoming connections.
  6. In the connection handler, set an event handler on the XPCConnection to receive messages.

License

Copyright 2011 XPCKit

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

Relayout

Swift microframework for declaring Auto Layout constraints functionally
Swift
555
star
2

Barista

A modular, embeddable web server for Objective-C.
Objective-C
500
star
3

DerpKit

Objective-C categories and subclasses of things that should be in Foundation and other frameworks
Objective-C
137
star
4

IIIAsync

Concurrency control flow system for Objective-C
Objective-C
113
star
5

DevCenter.me

Directory of developer center websites with memorable URL shortcuts
CSS
80
star
6

awesome-ios-widgets

A curated list of home screen widgets for apps on iOS 14+
74
star
7

VillainousStyle

A standalone Mac/iPhone port of the TTStyle and TTShape classes from the Three20 project
Objective-C
70
star
8

EasyTweet

A simple Objective-C wrapper for the Twitter API with no OAuth dependencies
Objective-C
60
star
9

CrashReporter

Send iOS crash reports by email
C
57
star
10

url-shrink

URL Shrink provides a system-wide utility to shorten and expand URLs across multiple services (is.gd, bit.ly, etc.)
Objective-C
47
star
11

sscore

Cocoa code I use just about everywhere.
Objective-C
36
star
12

better-xcode-templates

A package of better Xcode templates for iPhone and Mac
Objective-C
34
star
13

CoreFoundation

A git-based mirror of the official CoreFoundation code
C
29
star
14

Swearch

An iOS-optimized web app for accessing search engines
JavaScript
29
star
15

PlayerPiano

A Pianobar GUI for Mac OS X Snow Leopard
C
29
star
16

oauthery

Tool for manually logging into Twitter using OAuth, with Cocoa code demonstrating the OAuth login process for Twitter
Objective-C
27
star
17

MWNetworking

Right now, one Objective-C class to download a thing. Eventually, DOWNLOAD ALL THE THINGS.
Objective-C
23
star
18

BlockKit

YOU get a block, YOU get a block, EVERYONE gets a block!
Objective-C
20
star
19

caboose

A Mac client for getting push notifications from the Boxcar service
C
16
star
20

TOML

Kind-of-works TOML parser for Objective-C
Objective-C
12
star
21

AppApp

AppApp is an iOS app for http://app.net. It was hastily copy pasted together at 3am.
Objective-C
11
star
22

TDAppKit

Git mirror of TDAppKit from @itod
Objective-C
11
star
23

EmbedMonster

Universal (eventually) audio/video controller JavaScript API for embeddable media
JavaScript
9
star
24

MiniPiano

An iPhone app which plays music from Pandora
Objective-C
7
star
25

html5playlist

A simple web app to play a playlist
JavaScript
7
star
26

node-pop3

A POP3 library for node.js. Maybe it'll work one day.
6
star
27

technicolor

Media organization tool for Mac OS X
Objective-C
6
star
28

fightclub

Cocoa framework for connecting to Hellanzb servers
Objective-C
6
star
29

Colloquy

Git port of the Colloquy IRC client for Mac
Objective-C
6
star
30

hal-project

Home automation project written in Python for Arduino boards (SVN mirror)
Python
6
star
31

lessn-service

OS X Service for shortening a URL using your installation of Lessn/ButteredURLs
Objective-C
6
star
32

ZNC-Node

A module for ZNC to add node.js-based modules
C++
4
star
33

flash-machine

Cocoa application to host SWF files and bookmarks to SWFs
Objective-C
4
star
34

technicolor-networking

A set of networking plugins for Technicolor, including a shared HTTP server
Objective-C
3
star
35

bmo

Plugin-based XMPP bot
JavaScript
3
star
36

NudeWiki

A wiki, built with Node.js and MongoDB, because that's what you build when learning new server-side technologies
JavaScript
2
star
37

facebook-iphone-sdk

Facebook Connect for iPhone
Objective-C
2
star
38

dock-killer

OS X app for killing the dock via the menu bar
Objective-C
2
star
39

technicolor-file-importer

A simple plugin for Technicolor to demonstrate importing files into records
Objective-C
2
star
40

StatsKit

An open source analytics system for developers on any platform. In development.
JavaScript
2
star
41

turntable.userscripts.fm

Various userscripts for turntable.fm
JavaScript
2
star
42

csh-drink-iphone

iPhone client for the CSH Drink machines
2
star
43

node-pq

A Redis-backed priority queue for node.js.
JavaScript
2
star
44

dotfiles

Various dotfiles
Shell
2
star
45

technicolor-fuse

A FUSE plugin for accessing files stored in Technicolor
Objective-C
2
star
46

Boxque

A node.js-based server framework for queueing Boxcar notifications through Resque
JavaScript
2
star
47

node-boxcar

A node.js Connector for Boxcar
1
star
48

bitlbee

Mirror of the Bitlbee project, with some of my own changes
C
1
star
49

InformalProtocolTheme

Theme for InformalProtocol.com
JavaScript
1
star
50

CoreMustache

C
1
star
51

js-calendar-picker

A small calendar picker written with jQuery which reveals itself as needed.
1
star