2

I want to have an URI for my app. For example, if my app's name is "GetIt":

getit://

Is there an easy way to create one?

jscs
  • 63,694
  • 13
  • 151
  • 195
papr
  • 4,717
  • 5
  • 30
  • 38

3 Answers3

2

Create an Apple event handler for the GetURL event, then put a list of URL schemes in your app bundle. Kimbro Staken has a blog post with more details.

I think there's some reusable Cocoa source code floating around that takes care of the AE handler for you, but I forgot its name and where to get it.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
1

Unless you're planning to make your application scriptable the simplest method is probably to just register an Apple Event handler for this. CocoaDev has a good example of how to do it.

Matt Stevens
  • 13,093
  • 3
  • 33
  • 27
0

Additionally, Craig Hockenberry has a nice writeup on implementing custom URL schemes in iPhone applications. I haven't tried this on the desktop in Cocoa, so I don't know how much will translate across.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • I can't reply to your message to me again, so I'll make a discrete comment here. I edited all the things in question, and have made them my own. Just because they have similar formatting does not mean they are plagiarized. Also, I do not really appreciate you deleting my highest scoring answer. – syb0rg Feb 27 '13 at 22:22
  • @syb0rg - A large chunk of that answer is still copied from polygenelubricants'. I don't care about the votes on an answer, if you are claiming credit for the work of others I will remove it. As it stands, you still need to provide appropriate attribution to indicate that you drew this from polygenelubricants' answer. Changing a few words here and there is not good enough. Either write your own take on something or use blockquotes and links to indicate sourcing. – Brad Larson Feb 27 '13 at 22:32
  • [Added reference](http://stackoverflow.com/questions/14739831/what-are-the-3-dots-in-parameters-what-is-a-variable-arity-parameter/14740061#14740061) to main answer, now I would be really happy if you could restore it. – syb0rg Feb 27 '13 at 23:49
  • @syb0rg You didn't do much to actually make the answer stand out. Yes, everything here is licensed under the cc-Wiki license, which means you can use it as long as you provide proper attribution. However, *on* the site, it's not good enough to just copy an answer with minor modifications (that add nothing to the answer) and then try to gain reputation from it. At best, you should have looked to see if this question is a duplicate of the question the answer was on, and flagged for moderator attention to close it as a duplicate (as using the same answer is a good indication). – casperOne Feb 28 '13 at 17:42
  • @syb0rg In other words, please try to add more original content. It's fine to use other content as a base, but your content should add *significantly* to the base, adding what the original did not. You failed to do that in this case. – casperOne Feb 28 '13 at 17:43