title: NSUserDefaults synchronize fails when the application quits
body: <p>I’m using Xcode 8 under OS X 10.11.6 but the problem persists with Xcode 7. I have a main application and it’s helper, they share a group container.</p>
  
  <pre><code>prefsFile = [[NSUserDefaults alloc] initWithSuiteName:kAppGroupName];
  </code></pre>
  
  <p>When I synchronize the NSUserDefaults during the session, all works fine but the helper needs to synchronize the preferences file when it receive the applicationShouldTerminate message : when the Mac shuts down or is restarted. It seems that synchronize in this case has no effect and is ignored. Not always but sometimes, randomly.</p>
  
  <p>I always test the returned value of the method synchronize and this value is always YES. If NO, a message is sent to the log of the application.</p>
  
  <p>Is there a way to solve the problem ?</p>