I have an app which uses MDM settings pushed from Miradore.
I can read out the settings using:
NSDictionary *serverConfig = [[NSUserDefaults standardUserDefaults] dictionaryForKey:"com.apple.configuration.managed"];
I want to add an observer to only trigger a function when "com.apple.configuration.managed" is changed and no other NSUserDefaults value.
Currently the observer is triggered for all NSUserDefaults changes. The code for this that I have is:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(readDefaultsValues:) name:NSUserDefaultsDidChangeNotification object:nil];
Does anyone know how to only observe changes to "com.apple.configuration.managed"?