I want to understand the functionality of,
[NSUserDefaults standardUserDefaults] registerDefaults:];
Does registerDefaults method set the default value and not the actual value. For example, assuming i execute the following statements in sequence,
[[NSUserDefaults standardUserDefaults] setObject:@"1" ForKey:@"test"];
and then call,
[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:@"2",@"test", nil]];
I see that valueForKey test is still 1 and not 2. Could someone provide me a better understanding of registerDefaults or is my above anology right? If my anology is right,then does it mean that the default value is picked up only when no object is set for that specific key? Thanks in advance.