• 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
Why is writeRows not being called in NSOutlineView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is writeRows not being called in NSOutlineView?


  • Subject: Why is writeRows not being called in NSOutlineView?
  • From: Steve Palmer <email@hidden>
  • Date: Fri, 3 Jun 2005 22:00:19 -0700

This is probably an obvious one but I seem to be missing something.

I'm trying to implement dragging nodes in an NSOutlineView to reorder them. I have what seems to be all the prerequisite methods implemented but writeRows is never being called. When I click and start dragging in the outline view, it simply moves the selection around.

My writeRows function is declared as:

-(BOOL)outlineView:(NSOutlineView *)olv writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard 

and the other functions are:

-(BOOL)outlineView:(NSOutlineView *)olv acceptDrop:(id)info item:(id)targetItem childIndex:(int)childIndex 

-(NSDragOperation)outlineView:(NSOutlineView*)olv validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)index

I've registered a custom pasteboard type in awakeFromNib:

    NSString * MyCustomPBoardType = @"SPCustomPBoardType";
    ....

    // Register for dragging
    [outlineView registerForDraggedTypes:[NSArray arrayWithObject:MyCustomPBoardType]]; 
    [outlineView setVerticalMotionCanBeginDrag:YES];

Unfortunately it doesn't work. What are the possible reasons why writeRows won't be called when initiating a drag in an NSOutlineView? (I've taken a look at the DragNDropOutlineView example which works fine for me but comparing implementations suggests nothing obvious). This is with XCode 2.0 and Tiger, incidentally.

Thanks!

 _______________________________________________
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

  • Follow-Ups:
    • Re: Why is writeRows not being called in NSOutlineView?
      • From: Corbin Dunn <email@hidden>
    • Re: Why is writeRows not being called in NSOutlineView?
      • From: Todd Ransom <email@hidden>
  • Prev by Date: Re: Catching edits to items in a table view using bindings
  • Next by Date: Re: Why is writeRows not being called in NSOutlineView?
  • Previous by thread: Re: ScreenSaverView/NSQuickDrawView/Opaque issue [solved]
  • Next by thread: Re: Why is writeRows not being called in NSOutlineView?
  • Index(es):
    • Date
    • Thread