• 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
Drag and drop problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag and drop problem


  • Subject: Drag and drop problem
  • From: Michael Becker <email@hidden>
  • Date: Mon, 3 Apr 2006 21:41:05 +0200

Hi everybody,

although I have implemented Drag&Drop many times before, right now I can't seem to get it right. I have an NSView subclass, here's pretty much what I do in its -mouseDragged method:

- (void)mouseDragged:(NSEvent*)event
{
	. . .

	NSLog(@"%@", data);

// Get the pasteboard
NSPasteboard* pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
[pasteboard declareTypes:[NSArray arrayWithObject:SGPASTEBOARDTYPE] owner:self];
[pasteboard setPropertyList:data forType:SGPASTEBOARDTYPE];

NSLog(@"%@", [pasteboard propertyListForType:SGPASTEBOARDTYPE]);


[data release];

// Start the drag
[self dragImage:dragImage at:point offset:NSZeroSize event:event pasteboard:pasteboard source:self slideBack:YES];
}


The first NSLog prints out the contents of data (which is an NSMutableArray), the second NSLog, however, prints out "(null)". I really don't see what I am missing. This is just bugging the hell out of me :-)

Maybe you got some hints?

Regards,
Michael

_______________________________________________
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


  • Prev by Date: Re: Strange indexOfTabViewItemWithIdentifier behavior
  • Next by Date: Re: Strange indexOfTabViewItemWithIdentifier behavior
  • Previous by thread: Re: Strange indexOfTabViewItemWithIdentifier behavior
  • Next by thread: Unwanted artifacts when using controls in NSView subclass
  • Index(es):
    • Date
    • Thread