views:

42

answers:

2

Hi, I am currently in the planning phase for a scheduling and data tracking software. I want to let the primary user add password protected profiles to the program so that different people can use the program with access to different sets of the data and different capabilities. On of the things that I would like to add is the ability to change the layout and colors of your own profiles landing page. So is it possible to have multiple sets of preferences on a single mac user account? I need it to be on a single mac account because this will be a program for families and some of the created profiles will be for kids who might not have there own account.

Thanks.

SOLVED: I think I may have figured out how to do this. If anyone wants to see my solution I have uploaded the file at: http://www.mediafire.com/file/vp7k2ybygcs63cf/PrefGenTest.zip

If you keep an eye on the console and the properties plist of the program you will see the result.

+1  A: 

NSUserDefaults doesn't have any features that would make this easy. If you drop down to CFPreferences, you could use different preference files for different users, but you'd lose the convenience of using NSUserDefaults and NSUserDefaultsController.

JWWalker
+1  A: 

It sounds like you might want to make the different users entities in a Core Data store.

Peter Hosey
I was thinking i might do this. Do you think that maybe I should try creating a 'properties' entity inside my core data store that will store different preferences from the NSUserDefaults file? Or would this go against recommended usage of cocoa preferences?
Wizecoder
Mac OS X apps are normally only used by a single user at a time, through the user accounts system. An application that explicitly supports different people accessing it through the same account is highly unusual, and you will need to implement all the access control yourself to pull it off.
Peter Hosey