• 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
Can't drag a custom data object.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't drag a custom data object.


  • Subject: Can't drag a custom data object.
  • From: Billy Flatman <email@hidden>
  • Date: Mon, 26 Apr 2010 13:58:04 +0100

Hi all,

I'm trying to put a custom object into past board in order to perform a drag operation. It's working fine if I drag a string, but if I try to pass an object, I can't get it to work.

- (BOOL)outlineView:(NSOutlineView*)outlineView writeItems:(NSArray*)items toPasteboard:(NSPasteboard*)pboard {

	NSString* kOutlineViewGroupType = @"IFNode";

	[pboard clearContents];

	if([[items objectAtIndex:0] isParent]) {

		return NO;
	}

	itemsBeingDragged = items;

	[pboard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, kOutlineViewGroupType, nil] 				owner:nil];

	** This works.
	[pboard setString:[[items objectAtIndex:0] title] forType:NSStringPboardType];

	** This doesn't (actually stops drag and drop working for my application until I logout).
	[pboard setData:[items objectAtIndex:0] forType:kOutlineViewGroupType];

return YES;
}

Any help greatly appreciated.

Cheers,

Billy Flatman
email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can't drag a custom data object.
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Creating temporary NSManagedObjects (PS)
  • Next by Date: XCode 3.2.2 Hangs after Clean All but Previous Version Doesn't
  • Previous by thread: Re: CoreData validation question
  • Next by thread: Re: Can't drag a custom data object.
  • Index(es):
    • Date
    • Thread