1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Registing a URL handler with your application

Discussion in 'Mac Programming' started by satyam90, Jun 2, 2009.

  1. macrumors regular


    I want to add URL handler for my application. On searching google, I found some information.
    In my application, I am following the procedure mentioned in the website Registering URL handler

    In the method
    - (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
    I just added "NSLog" statement to print the URL and monitoring the console log.

    I compiled the code in "Release" mode. Now for running the application, I open safari browser and entered "myapp://some_action_or_resource", then press "Enter". Now its opening the application.
    I expected "some_action_or_resource" in the console log.
    But its not printing the URL. Do I have to do anything in addition to get the URL printed in console log. If I get the URL, I will do other processing needed.
  2. macrumors regular


    I found the solution.

    In my code I am registering the event in applidcationDidFinishLaunching.
    To solve this issue, it must be done in "init" method.


Share This Page