Newbie Q - Variables not being retained in class
Newbie Q - Variables not being retained in class
- Subject: Newbie Q - Variables not being retained in class
- From: Jack <email@hidden>
- Date: Fri, 09 Sep 2005 23:00:51 -0400
> which
> means that defaultPrefs is finally released and dealloc'd.
RegisterDefaults: retains the values inside the dictionary as they are added
to the NSRegistrationDomain.
The code is fine. What might be happening is your confusing what
registerDefaults: does. It creates a new domain lower than your
com.application domain. The .plist file that you are seeing in your library
is actually empty. Starting up your app an second time and calling
savePrefs: without first calling setupPreferences: will give you nil. Not
only because your instance variable myPrefs is not initialized (which you
shouldn't use as was pointed out earlier) but also because you need to
register the defaults every single time you start the app. The defaults are
just that a backup value if no value exists in your regular com.application
domain.
Regards,
Jack
www.Bruji.com
_______________________________________________
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