Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RobRiley

macrumors member
Original poster
Feb 4, 2009
35
0
London
Hi,

Ok so I have set up a preferences view for my application and bound it using an NSUserDefaults controller. Simple. But I want different parts of my app to bind to different plists in different places. Is it possible to use multiple NSUserDefaults controllers bound to different plists in a single app? If so, how? And where would I specify the filepaths for these files?

Thanks :)
 
NSUserDefaults uses the app's bundle identifier for its plist, so you cannot use it for other plists other than preferences. What you need to do is implement your own custom class that reads and writes to a plist and supports KVC for bindings. Here's a sample project that demos one way to do this:
 

Attachments

  • PlistController.zip
    57.2 KB · Views: 85
You legend! That is really helpful for me. Thanks so much :)

You haven't written any books on this by any chance?!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.