How do I register a new schema in cocoa / objective-c?

I'm looking for a simple tutorial (framework?) That will explain to me the basic steps I have to take to register a new schema and handle it with my application written in objective-c and cocoa.

Explanation: Some applications, such as Adium, have registered schemas. The schema for the user is a URI, for example "adiumxtra: //www.adiumxtras.com/download/6636". Thus, when the user clicks on it (in a web browser or chat, etc.), Mac OS understands that Adium is responsible for the "adiumxtra" protocol and directs the user's request for the content of the Adium and Adium processes at the given URI.

I would like to do something similar. I've already checked the Adium source, but the "schema" handling is implemented in a rather complicated way ... Maybe someone can explain this to me "a little"? :-)

Thanks in advance!

+2


source to share


2 answers


You mean URL schemes, not schemas (which are XML or Sync Services).

The first step is to add CFBundleURLTypes to your Info.plist application.



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

+6


source


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



+2


source







All Articles