• 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: Row dragging ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Row dragging ...


  • Subject: Re: Row dragging ...
  • From: Herr Witten <email@hidden>
  • Date: Sat, 31 Jan 2004 17:43:42 -0500

Here is a better example:

- (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id
<NSDraggingInfo>)info row:(int)row
dropOperation:(NSTableViewDropOperation)operation
{
NSArray* objects = [NSKeyedUnarchiver unarchiveObjectWithData:
[[info draggingPasteboard] dataForType: @"draggingData"]];

NSMutableIndexSet* indexes = [NSMutableIndexSet
indexSetWithIndexesInRange: NSMakeRange(row, [objects count])];

if (operation == NSTableViewDropOn)
[indexes shiftIndexesStartingAtIndex: row by: 1];

[self insertObjects: objects atArrangedObjectIndexes: indexes];
[self removeObjects: _draggingObjects];

return YES;
}

On 31 Jan 2004, at 5:22 PM, Herr Witten wrote:

> - (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id
> <NSDraggingInfo>)info row:(int)row
> dropOperation:(NSTableViewDropOperation)operation
> {
> NSMutableArray* content = [NSMutableArray arrayWithArray: [[self
> content] copy]];
>
> NSArray* objects = [NSKeyedUnarchiver unarchiveObjectWithData:
> [[info draggingPasteboard] dataForType: @"draggingData"]];
>
> /*go through objects and insert them into the proper places*/
>
> return YES;
> }
_______________________________________________
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: 
 >Row dragging ... (From: J Nozzi <email@hidden>)
 >Re: Row dragging ... (From: Herr Witten <email@hidden>)

  • Prev by Date: Re: Cocoa/Windows parallel dvlpmt
  • Next by Date: Re: Duplicating the cosmetics of the System Preferences Panel
  • Previous by thread: Re: Row dragging ...
  • Next by thread: Re: Row dragging ...
  • Index(es):
    • Date
    • Thread