views:

61

answers:

2

Hi guys,

I am looking for a simple tutorial (framework?) that will explain me basic steps that I have to do to register new schema and handle it with my app written in objective-c and cocoa.

Explanation: Some apps like Adium, has registered schemas. Schema for the user is an URI like "adiumxtra://www.adiumxtras.com/download/6636". So, when the user clicks on it (in a web browser, or chat etc.), Mac OS understands that Adium is responsible for protocol "adiumxtra" and directs user's request to Adium and Adium processes content on the given URI.

I would like to do something similar. I already checked Adium's source, but "schema" handling is implemented in a quite tricky way... Maybe somebody can explain it to me in a "little bit" easy way? :-)

Thanks in advance!

+6  A: 

You mean URL schemes, not schemas (which would refer to either XML or Sync Services).

The first step is to have a CFBundleURLTypes entry in your app's Info.plist.

The second step is to implement an Apple Event handler to handle the getURL event.

Peter Hosey
Thank you! This is exactly what I was looking for!
MinimeDJ
I already implemented all needed functionality with URL schemes!
MinimeDJ
+2  A: 

For the iPhone, Craig Hockenberry has a good example, with source code, of how to use custom URL schemes in his post here.

Brad Larson
Thank you very much for your reply! It is very useful indeed!
MinimeDJ