I had been using standardUserDefaults
until recently but decided to use shared app groups because I created a watch extension. I have set up an app group and also added the ApplicationGroupContainerIdentifier
to the settings bundle.
I have spent hours on this and, even after reading many articles, I just can’t get this to work. I am seeing that when I alloc my app group and print its contents, it has default values from standardUserDefaults
.
All I am doing is [[NSUserDefaults alloc] initWithSuiteName: SUITE_NAME]]
and then print its contents on the very next line.
I am puzzled by how it has values from my settings bundle. Moreover, when you edit the properties using the settings app, the settings in standardUserDefaults
are changing but my app group values stay the same.
I see the same behaviour on the simulator and real device.