Re: Initial Prefs Setting Of Checkbox?
Re: Initial Prefs Setting Of Checkbox?
- Subject: Re: Initial Prefs Setting Of Checkbox?
- From: "Chunk 1978" <email@hidden>
- Date: Wed, 31 Dec 2008 14:59:13 -0500
ok i get that... however, what if a developer intends to leave all
checkboxes in preferences unchecked as the initial defaults, and there
are only checkboxes or radio buttons, no colors, no numbers, etc... is
it considered bad practice to not register these defaults if they are
bound? or is it better to keep code to a minimum and not register the
defaults... are there any problems that can arise from not having
defaults registered if their initial settings of the checkboxes is
desired?
On Wed, Dec 31, 2008 at 12:34 PM, Matt Neuburg <email@hidden> wrote:
> On Tue, 30 Dec 2008 23:25:03 -0500, "Chunk 1978" <email@hidden> said:
>>i have a few checkboxes in my prefs window which are bound... however,
>>i was under the impression that i could easily set the very first load
>>state of these boxes in IB by checking "Selected" (Inspector >
>>Attributes > Visual > Selected) before the userdefaults are written...
>
> There are two misunderstandings here, and the most important of them is the
> second one, "before the user defaults are written". There should be NO SUCH
> TIME. It is up to you register the default defaults (that is, the "initial"
> value for user defaults before the user has had any chance to express an
> opinion) before the app even finishes loading for the first time. That is
> exactly what "registerDefaults" is for. In some cases, finding a
> sufficiently early entry point can be a challenge; I typically resort to
> +initialize.
>
> m.
>
> --
> matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
> A fool + a tool + an autorelease pool = cool!
> One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
> AppleScript: the Definitive Guide - Second Edition!
> <http://www.amazon.com/gp/product/0596102119>
>
>
>
>
_______________________________________________
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