• 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
NSOutlineView, Drag-and-Drop, [NSCFArray expandable]: selector not recognized
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOutlineView, Drag-and-Drop, [NSCFArray expandable]: selector not recognized


  • Subject: NSOutlineView, Drag-and-Drop, [NSCFArray expandable]: selector not recognized
  • From: "Kirt Cathey" <email@hidden>
  • Date: Mon, 22 Aug 2005 22:01:20 +0000

Hi All.

Found a great note in the cocoa-dev archives about setting up an NSOutlineView for Drag-and-Drop. It's in a posting from a 'Lorenzo' to a 'Johnny Deadman' . This got me most of the way there. Thanks.

However, when I drop onto a node, myOutlineView freezes and an error, '[NSCFArray expandable]: selector not recognized' shows up in the log.

Here is some of the code:

- (BOOL)outlineView:(NSOutlineView *)outlineView
        acceptDrop:(id <NSDraggingInfo>)info item:(id)targetItem
        childIndex:(int)childIndex
{
   NSPasteboard    *pboard = [info draggingPasteboard];
   NSArray *myTypes = [NSArray arrayWithObjects:MyItemsPboardType, nil];

   if([pboard availableTypeFromArray:myTypes] != nil){
       NSData *itemsData = [pboard dataForType:MyItemsPboardType];

/////////////////////// My Code Starts here///////////////////////////////
// row and level for source item declared above in // - (BOOL)outlineView:(NSOutlineView*)olv writeItems:(NSArray*)items
// toPasteboard:(NSPasteboard*)pboard
// currentLevel // currentRow
///////////////////////////////////////////////////////////////////////

//targetItem is the parentNode!!!

int destinationLevel = [myOutlineView levelForItem:targetItem];
int destinationRow = childIndex + 1;
// Unarchive source item
Node *sourceItem = [NSKeyedUnarchiver unarchiveObjectWithData:itemsData];
//
if ((currentLevel == 1) && (destinationLevel == 0))
{
Node *replacementNode = [sourceItem copy];
[targetItem insertNode:replacementNode atIndex:destinationRow];
[targetItem removeNodeAtIndex:currentRow];

[myOutlineView reloadData];
}


....
...
...


Thanks in advance for the help!

Regards,
Kirt Cathey
http://www.bizolutions.com

_________________________________________________________________
無料でメールボックス250MBの 「MSN Hotmail」 http://messenger.msn.co.jp/


_______________________________________________
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: open docs at quit time
  • Next by Date: Re: open docs at quit time
  • Previous by thread: URL Loading Question
  • Next by thread: addObject failing
  • Index(es):
    • Date
    • Thread