NSUserDefaults initWithSuiteName on 10.11

I have an OSX app and a FinderSync extension that are sharing preferences using NSUserDefaults -initWithSuiteName. This works fine on OSX 10.10 - the main app and the extension successfully read/write preferences to ~/Library/Group Containers/<group>/Library/Preferences/<group>.plist. However, this same code does not seem to be working on the 10.11 GM. Under 10.11, the extension seems to be using ~/Library/Group Containers/<group>/Library/Preferences/<group>.plist correctly, but the main app seems to be using ~/Library/Preferences/<group>.plist. Both the app and the extension have com.apple.security.application-groups entitlements for <group>. Interestingly, when the main app is run under Xcode on 10.11, it correctly uses the Group Container preferences.


Is this a bug in 10.11? Or did I miss some new security setting or entitlement change that is needed?

A further data point: the main app uses the correct preferences when the binary is invoked directly, e.g., /Applications/<app>/Contents/MacOS/<app>. It does not use the correct preferences when invoked using "open /Applications/<app>"

It turns about that this only seems to happen with certain bundle ID's and group names. The bundle ID of my main app is a.b.c and I was using the group name a.b.c.d. I changed my group name to <TeamID>.a.b.c.d and the problem went away. Thus it appears that having a group name prefixed with a bundle ID causes problems.

NSUserDefaults initWithSuiteName on 10.11
 
 
Q