Re: Okay to leave -concludeDragOperation: empty?
Re: Okay to leave -concludeDragOperation: empty?
- Subject: Re: Okay to leave -concludeDragOperation: empty?
- From: Jeremy Dronfield <email@hidden>
- Date: Tue, 27 Apr 2004 19:27:01 +0100
On 27 Apr 2004, at 5:20 pm, matt neuburg wrote:
I believe the problem is that text views are special. A text view
already
implements drag and drop (that is, it can already receive a text
drop), and
it relies on -concludeDragOperation; in fact, I think the real work of
inserting the text is done there. So unless you implement it (possibly
empty), you interfere with the text view's system receiving a drop. You
should probably conform to this: you should do the real work in
-concludeDragOperation if the work is yours to do, and call super
otherwise.
This is what I suspected, which is why I asked the question. At the
moment I'm doing my work in -performDragOperation:, with
-concludeDragOperation: left empty, which, as you confirm, doesn't seem
right. On the other hand, the following code (upon which I based my
implementation) comes from the Cocoa documentation:
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *pboard = [sender draggingPasteboard];
if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {
NSArray *files = [pboard
propertyListForType:NSFilenamesPboardType];
int numberOfFiles = [files count];
// Perform operation using the list of files
}
return YES;
}
The same document
(/Developer/Documentation/Cocoa/Conceptual/DragandDrop) has little or
nothing to say about -concludeDragOperation:. Perhaps it depends on the
programmer's personal notion of the semantic difference between
"perform" and "conclude"...?
Regards
-Jeremy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.