• 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: Bindings for NSComboBox?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings for NSComboBox?


  • Subject: Re: Bindings for NSComboBox?
  • From: "Adam Gerson" <email@hidden>
  • Date: Wed, 2 Apr 2008 13:17:28 -0400

You could set up a delegate for the combo box and implement
controlTextDidEndEditing. Then programatically add the value to your
array controller:

NSManagedObjectContext * context = [[NSApp delegate] managedObjectContext];
NSManagedObject *yourObject = [NSEntityDescription
insertNewObjectForEntityForName: @"entityName" inManagedObjectContext:
context];

[server yourObject:[comboBox stringValue] forKey: @"key"];




On Mon, Mar 31, 2008 at 4:44 PM, David Springer <email@hidden> wrote:
> All,
>
>  I'm having trouble setting up the bindings for my NSComboBox.  I bind
>  the NSComboBox's content to NSArrayController's arrangedObjects.  This
>  works fine.
>
>  Now, I want to add to the content array when you enter a new string
>  into the combo box.  Say, for example, I start with an array of @"file
>  1", @"file 2", @"file 3".  Then, in the combo box, I enter "file foo".
>   I want to add this string to the content array, but I am at a loss as
>  to how to set up the bindings to do this.  Do I bind NSComboBox's
>  value to something?  My experiments in doing this so far are failing.
>
>  Help?
>  - Dave.S
>  _______________________________________________
>
>  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
>
_______________________________________________

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

  • Prev by Date: CoreData NSTextView changes: not noticed with KVO, not accessible from program, but stored anyway
  • Next by Date: Re: How to store NSRect as Core Data attribute?
  • Previous by thread: Re: Bindings for NSComboBox?
  • Next by thread: Problem with Grouping the rotated object.
  • Index(es):
    • Date
    • Thread