• 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 from Table To View
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag from Table To View


  • Subject: Drag from Table To View
  • From: email@hidden
  • Date: Sat, 25 Sep 2010 14:43:02 -0600

Earlier this I got help on dragging from NSView to NSView .. got it working just fine.

Made some changes and want to drag from a Table to the same view I had accepting drops previously.

I do this in my table sub class awakeFromNib

[self registerForDraggedTypes:[NSArray arrayWithObject:@"Obstacles"]];

and I implement

- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes: (NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {


NSLog(@"writeRowsWithIndexes %@", rowIndexes);

NSData *zNSIndexSetData = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
[pboard declareTypes:[NSArray arrayWithObject:@"Obstacles"] owner:self];
[pboard setData:zNSIndexSetData forType:@"Obstacles"];

return YES;
}



which as I understand the docs is all that is required to have a table as a drag source.


But, It don't work so what now brown cow?

Thanks -koko
_______________________________________________

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: Drag from Table To View
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: In-app SMS
  • Next by Date: Class Instance Storage
  • Previous by thread: Re: In-app SMS
  • Next by thread: Re: Drag from Table To View
  • Index(es):
    • Date
    • Thread