• 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
Re: NSComboBox and sorted list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSComboBox and sorted list


  • Subject: Re: NSComboBox and sorted list
  • From: Frédéric Testuz <email@hidden>
  • Date: Sat, 26 Apr 2014 17:14:40 +0200

Le 18 avr. 2014 à 13:32, Frédéric Testuz <email@hidden> a écrit :
>
> I have a typical CoreData application which display my entities in an NSTableView with an NSArrayController and a panel to edit the selected item.
>
> I have an entity Book with a NSString attribute type displayed in an NSComboBox. I want the drop down list of the combo box to display the previously chosen types. I have an NSArrayController bind with the Book entity and the managed object context.
>
> I can make it works by binding the NSComboBox :
> Content (or Content Values) -> email@hidden
> Value -> BookArrayController.selection.type
>
> Until this point all is well, but I want the list to be sorted. So I think I have to add a NSArrayController which will maintain the sorted list of types. I try this :
>
> TypeListArrayController :
> Content Array -> email@hidden
>
> NSComboBox :
> Content -> TypeListArrayController.arrangedObjects
> Value -> BookArrayController.selection.type
>
> But with this setting, when I open my document (when the window is displayed) it takes a looooooooong time. More than 10min when at first it takes 1s. I check by stopping in the debugger, the stack frame is more than 38000 with huge recursivity.
>
> Is there a solution with NSArrayController and binding or I have to implement a data source for the combo box manually ?

After trying some things I have it working by manually implementing the data source and observing my BookArrayController for change of the type property.

For information, in my second test, if dont bind the combo box to the array controller, there is no delay. So the recursive problem appears with the interaction of the bindings between NSComboBox<->TypeListArrayController and TypeListArrayController<->BookArrayController



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >NSComboBox and sorted list (From: Frédéric Testuz <email@hidden>)

  • Prev by Date: Re: ARC Retain Cycles
  • Next by Date: Re: ARC Retain Cycles
  • Previous by thread: NSComboBox and sorted list
  • Next by thread: cocoapods: Problem with loading nib for a NSWindowController
  • Index(es):
    • Date
    • Thread