• 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: Application information that all users can see
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Application information that all users can see


  • Subject: Re: Application information that all users can see
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 31 Jan 2007 23:55:40 +0100

Am 29.01.2007 um 16:11 schrieb David Brennan:
I want to add a counter for every time my app has been started. My app
is running in Cocoa, and I tried keeping this counter in the user
preferences using NSUserDefaults, but this will only work if there is
only one user.

How should I do this in Cocoa.

That's a little hairy. There's really no reliable place that your app can write to that every user can access. The app is run as the current user, which can only access its own files (that's a security measure). What you'd need to do would be to make your application install a so-called setuid-helper-tool, i.e. a small application that increases your counter that gets run as root or another privileged user, so it can access some central location where you keep this info.


Hmmm... or maybe you could just try writing a file containing your counter to /Users/Shared?

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Application information that all users can see (From: "David Brennan" <email@hidden>)

  • Prev by Date: Releasing WebView
  • Next by Date: Re: MenuStatusItem --
  • Previous by thread: Re: Application information that all users can see
  • Next by thread: Re: Application information that all users can see
  • Index(es):
    • Date
    • Thread