Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Row dragging ...



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.