• 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
Newbie Q - Variables not being retained in class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Newbie Q - Variables not being retained in class
      • From: Aaron Wallis <email@hidden>
  • Prev by Date: Re: Missing font?
  • Next by Date: Re: Newbie Q - Variables not being retained in class
  • Previous by thread: Re: Newbie Q - Variables not being retained in class
  • Next by thread: Re: Newbie Q - Variables not being retained in class
  • Index(es):
    • Date
    • Thread