• 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
Using NSUserDefaultsController with an NSPopUp button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSUserDefaultsController with an NSPopUp button


  • Subject: Using NSUserDefaultsController with an NSPopUp button
  • From: "David Rappo" <email@hidden>
  • Date: Mon, 30 Oct 2006 14:29:52 +1100

Hi,

I am experiencing problems using NSUserDefaultsController with an
NSPopUp button, and an NSArray of strings (the source array for the
NSPopUp button). The goal is to allow the user to add/remove strings
from the NSPopUp button, and for the program to remember the state of
the NSPopUp after the user quits and restarts.

My bindings are setup as follows:

* NSArrayController called colorArray

Its contentArray is bound to the NSUserDefaultsController with
controller key = values, and model key path = "colorArrayKey" (the key
for my array in the NSUserDefaults object)

The object class name is set to NSString.

* NSPopUpButton

Its contentValues are bound to the colorArray controller with
controller key = arranged objects. Model key path is empty

The selectedIndex is also bound to the colorArray controller with
controller key = selectionIndex. Model key path is empty.

So, as I understand things, I've provided the NSArrayController with
the key (colorArrayKey) for an array of strings in NSUserDefaults,
which it should use to populate the NSPopUp button.

When I run the app, the NSPopUp button on the screen contains a single
entry called "No Value".

Any help, or pointers to good tutorials/books on bindings would be appreciated.

Thanks,

David
_______________________________________________
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: newbie problems with master-detail relationship
  • Next by Date: Re: Owner/Group changes depending on which volume you're booted from?
  • Previous by thread: Getting an NSFileWrappers Contents?
  • Next by thread: Re: Using NSUserDefaultsController with an NSPopUp button
  • Index(es):
    • Date
    • Thread