• 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: Storing a value to access across app launches and even re-install
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storing a value to access across app launches and even re-install


  • Subject: Re: Storing a value to access across app launches and even re-install
  • From: Graham Cox <email@hidden>
  • Date: Wed, 20 Aug 2014 10:00:14 +1000

On 19 Aug 2014, at 3:25 pm, Navneet Kumar <email@hidden> wrote:

> I need to store a numeric value in the system and update and access it across every launch of my app.

NSUserDefaults


> Also is it possible to safely store it in the system so that it can be picked up even after a re-install of my app?

NSUserDefaults

> I want it to be secure, so that even a os x savvy user may not be able to delete/modify this value.


Not really possible - the user owns their own computer, they can do with them as they wish. However, there are ways to hide a setting so that it's harder to find. An easy-ish solution is to use CFPreferences in the 'by host' domain. It's not very hidden, but slightly more so than the normal user defaults. You can also write a value to a file in all sorts of locations (notwithstanding what sandbox might have to say about it) but a determined user can always find it and delete it. This is right and proper - as a user I have every right to know exactly what my computer is doing, and no part of it should be hidden or inaccessible from me.

--Graham





_______________________________________________

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: 
 >Storing a value to access across app launches and even re-install (From: Navneet Kumar <email@hidden>)

  • Prev by Date: How do I use loadAlternateHTMLString:baseURL:forUnreachableURL: with webView:didFailProvisionalLoadWithError:forFrame:?
  • Next by Date: Issuing NSTextField action message
  • Previous by thread: Storing a value to access across app launches and even re-install
  • Next by thread: Transparent NSImage in NSButton
  • Index(es):
    • Date
    • Thread