On Mar 3, 2010, at 8:24 PM, Laurent Daudelin wrote:

> I'm trying to debug a problem where an NSOutlineView, as part of a drag, 
> tries to create an instance of NSURL using "- (id)initWithString:(NSString 
> *)URLString relativeToURL:(NSURL *)baseURL" with a nil string and get the 
> following error:
> 
> *** Ignoring exception 'NSInvalidArgumentException' (reason '*** -[NSURL 
> initWithString:relativeToURL:]: nil string parameter') raised by 
> <NSOutlineView: 0x2d6a1a0> during a dragging session
> 
> It happens *after* I write the dragging items to a NSFilesPromisePboardType 
> pasteboard type. I have no idea where this NSURL is created.
> 
> I have tried to create a subclass of NSURL and make that class to pose as 
> NSURL but then, I'm getting all kind of unknown messages sent to instances of 
> various classes like:
> 
> -[NSCFString absoluteURL]: unrecognized selector sent to instance 0x30e940
> or
> -[%NSURL length]: unrecognized selector sent to instance 0x503930
> 
> I also set a future break on [NSException raise] but it's doesn't break on 
> that call.
> 
> How can I find where this initWithString:relativeToURL: comes from? The 
> problem is that it doesn't always happen. I tried to reproduce it but so far, 
> I'm not sure what I'm doing different that will trigger the bug. The drag is 
> from my app to the Finder. If I drag from within my app, the error never 
> occurs. It really seems to be with the NSFilesPromisePboardType pasteboard 
> type that this happens.
> 
> Anybody have any suggestion?

Do you properly implement -namesOfPromisedFilesDroppedAtDestination: (which is 
required)? Are you providing an array of valid string paths? The drag 
destination would convert the string paths to URLs, so this suggests that you 
are passing it invalid data.

Have you recently re-read "Drag and Drop Programming Topics for Cocoa" 
(particularly the dragging files section)? That should give you some clues.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to