• 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: Preferences....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferences....


  • Subject: Re: Preferences....
  • From: Shawn Erickson <email@hidden>
  • Date: Mon, 7 Mar 2005 15:48:04 -0800


On Mar 7, 2005, at 3:12 PM, R T wrote:

1. How do I setup an NSTextField to act on the
returnKey and use its floatValue to change a
Preference?

Review the docs on NSTextField, its delgates and NSUserDefaults.

2. Can an NSButton be set up to  trigger the Action at
a target AppController to retrieve a Preference and
display it in an NSTextField.

Yes it can but not sure why you need to have a button to trigger this when it can be done at initialization time and on notification of a change.


Anyway a quick run down... setup the button to target your app controller instance and a particular action. Then have that action use NSUserDefaults to read in what is needed and finally set the NSTextFields value (using an outlet pointed at it).

This seemed like such an easy thing to do but now its
like I'm trying to create a lightbulb from scratch...a
few well written lines would be of great help.

It is easy but one part of it requires using IB to either setup the target/action or bind things for the button (or do you really want to do it programatically) as well as setting up an outlet to the text field.


If you used bindings then all you would need to do is bind the text field value to the user defaults control using the key of the preference in question using IB.

-Shawn

_______________________________________________
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


References: 
 >Preferences.... (From: R T <email@hidden>)

  • Prev by Date: Preferences....
  • Next by Date: Re: Mail.app interface question
  • Previous by thread: Preferences....
  • Next by thread: Re: Preferences....
  • Index(es):
    • Date
    • Thread