Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Making apps multi-user aware

Making apps multi-user aware
Thread Tools
ruttopia
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status: Offline
Reply With Quote
Apr 9, 2002, 11:07 AM
 
I'm working on an OS X application in Cocoa and I would like to make this application multi-user aware. In other words, I want the preferences to be saved for each user in a location that only that particular user can access. Obviously, I assume this is under the home directory.

Is there a document by Apple that describes HOW this should be done - guidelines? I can't seem to find one on the developer site.

Any info would be great.

Thanks!
     
kamprath
Junior Member
Join Date: Apr 2000
Location: San Francisco, CA
Status: Offline
Reply With Quote
Apr 9, 2002, 02:25 PM
 
Originally posted by ruttopia:
<STRONG>I'm working on an OS X application in Cocoa and I would like to make this application multi-user aware. In other words, I want the preferences to be saved for each user in a location that only that particular user can access. Obviously, I assume this is under the home directory.

Is there a document by Apple that describes HOW this should be done - guidelines? I can't seem to find one on the developer site.

Any info would be great.

Thanks!</STRONG>

Check out the CFPreferences API. If you want a custom binary format for your preferences, use the Folder Manger to locate the User preference file.
--
Michael F. Kamprath
     
Apocalypse
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Apr 9, 2002, 04:41 PM
 
Luckily for you that is the way that it works by default. Just use NSUserDefaults and that will write a file with your bundle identifier (ie com.address.program) in their ~/Library/Preferences/ directory. Of course you can also make any paths you manually define relative to the current user's home by using NSString's stringByExpandingTildeInPath.

Hope that is what you were looking for,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
ruttopia  (op)
Forum Regular
Join Date: Oct 1999
Location: Baltimore, MD
Status: Offline
Reply With Quote
Apr 10, 2002, 07:59 AM
 
Both posts helpful - thanks!!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:18 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,