opening my programme specific documents by double-click

Discussion in 'Mac Programming' started by Till Roenneberg, Aug 22, 2008.

  1. Till Roenneberg macrumors newbie

    Joined:
    Aug 22, 2008
    #1
    I am new to Cocoa programming and certainly far from being a professional programmer. I wrote a lot of programmes in the old OS 7-9 where the issue below was no problem.

    In Cocoa, I don't know how to tell my programme (not document based) to open its own documents if they were double-clicked or dropped on the programme icon.

    I am sure that the answer is quite simple but I have looked for weeks on the web and couldn't find anything that helped me with this problem. Any hint is greatly appreciated.

    Thanks Till
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  3. Till Roenneberg thread starter macrumors newbie

    Joined:
    Aug 22, 2008
    #3
    Thanks. I have read this document (I am sure I still haven't done everything correctly).

    The problem is not, however, that my programme doesn't start when I double-click one of its own files - it does that perfectly.

    The problem is that I don't know what code to add so that the programme actually handles the file's content.


    Thanks TIll
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Ah sorry, your question didn't make that clear (at least to me).

    I think you probably want to look at the application:eek:penFile: method available to the NSApplication delegate object...
     
  5. Till Roenneberg thread starter macrumors newbie

    Joined:
    Aug 22, 2008

Share This Page