To highlight what I meant, create 2 sandboxed apps with the same app group, i.e: com.gietal.sandbox.group
On the first app, do the following:
Now on the second app, try to read the value from the shared group UserDefaults. At this point, it should return the expected value of 123
And try reading the value again from app 2. You would be surprised that it would still returns 123 instead of the expected nil.
However, if you reboot your mac and try reading the value of "myKey" from app 2 again, it will correctly returns nil this time!
So this made me believe that UserDefaults is being cached somewhere in the system and could get out of sync with the actual plist file where the values are stored.