• 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: Open files on drag and drop (creating a droplet application)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open files on drag and drop (creating a droplet application)


  • Subject: Re: Open files on drag and drop (creating a droplet application)
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 2 Sep 2006 16:49:20 +0200

Am 01.09.2006 um 20:21 schrieb Kevin Muldoon:
- (BOOL) application:(NSApplication *) anApplication openFiles: (NSArray *) filenames {

	[self runScriptWithFiles: [NSArray arrayWithObject: filenames]];

	return YES;

}

filenames is already an array. You don't need to wrap it in an array again. Also, if you provide no openFiles method, it will repeatedly call the openFile variant, so provide either, not both.


I have also used this code with a single file drop as well, but with no luck.

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

// [self runScriptWithFiles: [NSArray arrayWithObject: filenames]];


	 [self runScriptWithFiles: [NSArray arrayWithObject: aFileName]];

	return YES;

}

Check with the debugger that these methods are actually being called. Just set a breakpoint by clicking in the gutter to the left of your runScriptWithFiles line, and then run your app in the debugger ("Build and Debug"). If your breakpoints aren't triggered, you're either running a release ("deployment") build (which *never* breaks on breakpoints), or you didn't set up the object that has these handlers as the application delegate. NSApplication will *only* send this message to the application delegate. Not to any other objects.


Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ 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
References: 
 >Open files on drag and drop (creating a droplet application) (From: Kevin Muldoon <email@hidden>)

  • Prev by Date: Re: grey toolbar
  • Next by Date: post http problem in cocoa
  • Previous by thread: Open files on drag and drop (creating a droplet application)
  • Next by thread: converting NeXTstep NIB files to cocoa
  • Index(es):
    • Date
    • Thread