Newbie Delegate question - storing preference
Newbie Delegate question - storing preference
- Subject: Newbie Delegate question - storing preference
- From: Michael Hanna <email@hidden>
- Date: Sun, 14 Mar 2004 12:40:00 -0500
Hello, I have a trivial application that employs a preferences panel to
set and store preferences.
It won't store a property list in the ~/Library/Preferences, but I know
that's because I don't actually do [NSDictionary standardUserDefaults]
setObject: forKey:] anywhere(I have actually set the Bundle
Identifier). I think I do this in PreferencesController.m. I have two
NIB files, MainMenu.nib, and Preferences.nib. MainMenu.nib relates to
MyController object and Preferences.nib relates to
PreferencesController and contains the preferences panel.
So do I need a setPrefs() function in PreferencesController.m? I would
like to perform this function when the user closes the preferences
panel. I know I just can't wire the closing of the panel to the
setPrefs() function in IB, I was told by a Cocoa guru that I need to
delegate this task.
This has left me really confused. What is a delegate, why do I need one
and where and how do I set it. Which nib do I set this delegate in,
MainMenu or Preferences? I'm using 10.3 and xcode by the way.
The project is available below.
Another question, why is it that my DEFAULT_OPACITY_LEVEL is not
reflected in the slider value when the user opens the pref pane?
thanks for any help at all!
Michael
http://www.siddha.ca/~tao/prefster1.1.tar.gz
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.