开发者

Cocoa multiple user preferences on a single mac account?

开发者 https://www.devze.com 2023-01-09 12:13 出处:网络
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 pro

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.

开发者_StackOverflow中文版

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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消