Reputation: 186
I'm aware of the methods for migrating a non-sandboxed app to an app sandbox, although I would like to know what the best practices would be for updating files (mostly preference lists) once already in an app sandbox container?
Ultimately if there's a method similar to NSUserDefaults
that would work for updating my preference list in an app sandbox container that's what I'm looking to do.
Sources I've read:
• NSUserDefaults Class Reference
Upvotes: 0
Views: 194
Reputation: 41801
If you're actually storing preferences, just use NSUserDefaults. It works the same (from an API perspective) inside a sandbox as outside. It's really best to pretend that preferences aren't stored in plists though; relying on that implementation detail can have all sorts of unfortunate side effects on recent OSs, so just use the API.
If you're trying to modify arbitrary plists rather than storing preferences, don't use NSUserDefaults. Use NSPropertyListSerialization and read/write them directly.
Upvotes: 3