• 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
Re: Drag & Drop Launch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag & Drop Launch


  • Subject: Re: Drag & Drop Launch
  • From: John Pannell <email@hidden>
  • Date: Tue, 6 Dec 2005 14:20:40 -0700

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: Drag & Drop Launch
      • From: "I. Savant" <email@hidden>
References: 
 >Drag & Drop Launch (From: email@hidden)

  • Prev by Date: Re: "Cocoa Programming" by Scott Anguish
  • Next by Date: Re: "Cocoa Programming" by Scott Anguish
  • Previous by thread: Drag & Drop Launch
  • Next by thread: Re: Drag & Drop Launch
  • Index(es):
    • Date
    • Thread