• 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
Core Data Drag and Drop with Tree Controller
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data Drag and Drop with Tree Controller


  • Subject: Core Data Drag and Drop with Tree Controller
  • From: "Ian G. Gillespie" <email@hidden>
  • Date: Wed, 1 Jun 2005 15:10:07 -0400

I have read a few several posts regarding drag and drop with core data (e.g. http://www.cocoabuilder.com/archive/message/cocoa/ 2005/5/10/135449) and D-n-D with bindings (http://lists.apple.com/ archives/cocoa-dev/2005/Jan/msg00734.html including mmalc's Bookmarks example). I am trying to implement reordering of objects, via drag and drop, in an outline view but seem to be stuck.

The problem I am having seems to be that I can't remove an object, keep a reference of it around, and then re-insert it into my NSTreeController. The object gets removed, but never re-appears in my outline view. This is how I have tried to implement thus far:

1) In the writeRows:toPasteboard... delegate method I put the rows into an array called _draggedRows.
2) In my acceptDrop... delegate method I remove the dragged object by referencing it from _draggedRows and by calling removeObjectAtArrangedObjectIndexPath on my tree controller (I figure out the index path by using NSOutlineView's rowForItem:, etc).
3) I re-insert the object using the reference kept in the _draggedRows using insertObject:atArrangedObjectIndexPath. When I re- insert the object I have to use the private observedObject method to re-insert a non-_NSArrayControllerTreeNode. But the object never appears in the outline view at the insert location.


Does anyone have any suggestions as to why my re-inserted object doesn't appear in the outline view?
_______________________________________________
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: NSFileHandle and FIFO files
  • Next by Date: Re: Coredata schema question.
  • Previous by thread: Re: NSFileHandle and FIFO files
  • Next by thread: Handling observing CoreData undo's
  • Index(es):
    • Date
    • Thread