6

I have a class Field. Each instance contains an NSMutableArray of subfields, which are more Field objects.

For my UI, I'm using an NSTreeController and an NSOutlineView.

I'd like to be able to reorder and move the fields around by dragging. I'm not sure of the simplest way to do this. Most of the tutorials on the net seem to focus on Core Data, which is intrinsically unordered and thus requires more trickery to get to work. My model is based on arrays, which are ordered.

Most of the tutorials I can find were written in the Tiger era, where the prevailing wisdom ended up being "Don't use NSTreeController yet, it's buggy", or else they're focussed on Core Data.

Amy Worrall
  • 16,250
  • 3
  • 42
  • 65
  • "Most of the tutorials on the net seem to focus on Core Data, which is intrinsically unordered and thus requires more trickery to get to work." - Not so. Core Data gained support for ordered sets as a to-many relationship years ago. – Joshua Nozzi Dec 17 '14 at 16:27
  • Have you checked the NSTreeController functionalities that it provides? Does it offer support for reordering? – Cristik Apr 01 '15 at 21:12
  • The reason people say "Don't use NSTreeController yet, it's buggy" is because it's buggy and you shouldn't use it. Stick with NSOutlineView delegate/datasource methods and you will get it working much faster. – harrisg Jun 25 '15 at 13:37

0 Answers0