• 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: Okay to leave -concludeDragOperation: empty?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: Okay to leave -concludeDragOperation: empty? (From: matt neuburg <email@hidden>)

  • Prev by Date: NSThread or NSTimer
  • Next by Date: Re: NSThread or NSTimer
  • Previous by thread: Re: Okay to leave -concludeDragOperation: empty?
  • Next by thread: Getting NSFontPanel color changes
  • Index(es):
    • Date
    • Thread