Objective-C NSUserDefaults caching prevents another app from accurately reading changes
问题 I have one application that sets preferences. It uses those prefs, and so does another application. When I use the following code in the second application, it reads the preferences correctly once. NSUserDefaults* settings = [NSUserDefaults standardUserDefaults]; [settings addSuiteNamed:@"com.WVS.Wrestling-Tools"]; [settings synchronize]; // this just a shot in the dark.. didn't work [self setScoreboardIndex:[settings integerForKey:@"matName"]]; On subsequent calls of the same code, I get the