What I expect to happen:
I create an NSUserDefaults object with a username (NSString of my choosing right?) and when I save defaults it saves those defaults for just that user.
What actually happens:
When I try creating NSUserDefaults for different usernames they are always saved into the same com.companyname.appname.plist file so it seems to ignore the per-user part and just save app-wide.
My Question:
Does this work on iOS or only OSX? What am I missing? Shouldn’t I be getting a different plist file per-user? I reviewed the one .plist it does create in xcode and there’s nothing in there that tells the default it belongs to a particular username.
Yes you are misunderstanding it, but really it’s a badly named method.
Essentially it’s to allow Apps that run as root (or superuser) to access the UserDefaults for other users.
In this case, user is a unix user, not some arbitrary partitioning name that you (the developer) chooses.