NSUserDefaults Inconsistency or device inconsistency? - iPhone
<p>I have developed a server based app for iPhone. But according to client requirements and to avoid overloading on server side, <strong>i am required to store data on local end. It is all text and typically 2-4 MB in size.</strong>
For this i'm using <strong>NSUserDefaults</strong> instead of sqlite or CoreData.
The app has been tested successfully for around 2-3 months during it's development as well as post development testing and never shown any type of inconsistency in data storage, updation or deletion on any sort of iphone device from iphone 3G - iphone 4S.</p>

<p>Now there is an incosistency issue in the live app, <strong>when user leave the app idle on a screen for around 15-20 minutes</strong> and doesn't press home button means app is not in the background.
In this case, data seems to be lost.
But as soon as refresh app, in that case data appears again &amp; app starts functioning normal again.
Here lies the main problem that <strong>when i'm refreshing, i'm doing nothing but only fetching fresh data from the server it can be simply one to five records or nothing at all</strong>.
Then app is refreshed, all of the records are shown &amp; it functions normally.</p>

<p>I have been trying to spot the issue for around 3 days, and it's not happening on my device (iPhone 4S). As far as i can think, it seems to be problem with the old devices.</p>

<p>Previously in testing, none of this happened on old or new devices.
My questions are - </p>

<p><strong>a) Is this an incosistency in my coding?</strong></p>

<p><strong>b) Are NSUserDefaults not trustworthy for database management for live apps?</strong></p>

<p><strong>c) Is it a device version specific problem related to NSUserDefaults?</strong></p>

<p>Anybody faced/facing the problem with NSUserDefaults??</p>

<p>Please suggest me something i can do for this or tell me i have to do all the database work again for the next version using sqlite or CoreData.</p>

<p>Anyhow this is critically important and needs to be fixed.</p>

<p>Any help is appreciated in advance.</p>
