• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[SOLVED] Drag & Drop Launch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Drag & Drop Launch


  • Subject: [SOLVED] Drag & Drop Launch
  • From: email@hidden (Kris Rambish)
  • Date: Wed, 07 Dec 2005 23:19:41 +0000

John,
That is exactly what I needed!! I knew it had to be something obvious.

Thanks,
Kris

-------------- Original message --------------
From: John Pannell <email@hidden>

Hi Kris-


I believe these are the steps I took; it was some time ago when I did it. Note this is also for drops of folders only, although document drops should follow a similar pattern. These instructions are for XCode 2.2...


1. You must make your target aware of document types it can open. Select your target from the groups & files pane, and get info. In the properties tab, toward the bottom, you will see a list of document types. For folders, you must add a line where the properties are set as follows:
- OS Types = fold
- Store Type = Binary
- Role = Editor
- Package = checked
I would imagine you would add another line with info specific to your app and document type to open dropped documents. NOTE: if you are not seeing these options in the target inspector, you must upgrade your target (this confused me for a long time)... choose "Upgrade all targets in project to native" from the "Project" menu.


2. Your NSApp delegate must implement


- (BOOL)application:(NSApplication *)anApplication openFile:(NSString *)aFileName


The string is the path to the dropped folder/document.


Hope this helps!


John


John Pannell
Positive Spin Media
http://www.positivespinmedia.com


On Dec 6, 2005, at 1:56 PM, email@hidden wrote:


Hi All,
After much searching on mailing lists, books, and other sources I cannot find a straight forward answer to a very basic question. How do I make my application accept Files or Folders dragged onto its icon?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [SOLVED] Drag & Drop Launch
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Re: Where is origin transformation in Sketch example?
  • Next by Date: Simple NSTextList Example
  • Previous by thread: Re: Where is origin transformation in Sketch example?
  • Next by thread: Re: [SOLVED] Drag & Drop Launch
  • Index(es):
    • Date
    • Thread