• 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: NSUserDefaults Bindings Reset
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserDefaults Bindings Reset


  • Subject: Re: NSUserDefaults Bindings Reset
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 03 Nov 2015 20:31:15 -0800

> On 2015 Nov 01, at 04:58, Michael de Haan  <email@hidden> wrote:
>
> NSUserDefaults.standardUserDefaults().removePersistentDomainForName(bundleIdentifier!)

That line of code seems like it is pulling the rug out from under Cocoa Bindings, which might explain why they don’t work.

A better way to reset to default defaults might be to put your default defaults into a plist file in your app’s bundle, get its path with -[NSBundle pathForResource:ofType:], read in to a dictionary with -[NSDictionary dictionaryWithContentsOfFile:] and finally invoke -[NSUserDefaults registerDefaults:], passing the dictionary.

You might also need to remove existing objects using -removeObjectForKey: before you do that.  I’ve never tried it.
_______________________________________________

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


References: 
 >NSUserDefaults Bindings Reset (From: Michael de Haan  <email@hidden>)

  • Prev by Date: Re: Swift circular imports
  • Next by Date: debugging AutoLayout exception with no build errors
  • Previous by thread: NSUserDefaults Bindings Reset
  • Next by thread: Re: AppleScript-ObjC Bridge Question
  • Index(es):
    • Date
    • Thread