For storing some values in NSUserDefaults / keychains is there any advantage of having atomic or non-atomic properties?
Asked
Active
Viewed 295 times
2 Answers
2
The difference between "atomic" and "non-atomic" is that atomic requires that all of the data must be successfully written while "non-atomic" means "write as much as possible" (i.e. not necessarily all of it).
So for many things (e.g. small bits of data), there's not much of a practical difference between non-atomic or atomic.
But for larger blocks of data, then non-atomic vs. atomic actually makes a difference. Do you need to have the data that's written to be 100% perfect and complete, or can your app handle just some of whatever has been written to default or the keychain?
![](../../users/profiles/-1.webp)
Community
- 1
- 1
![](../../users/profiles/981049.webp)
Michael Dautermann
- 86,557
- 17
- 155
- 196
-
So under this scenario, it is upto the application, I got it. Thanks buddy :) – Anoop Vaidya Dec 05 '12 at 16:57