---
title: "Best way to save data on the iPhone"  
description: "Best way to save data on the iPhone"  
author: "Anonymous User"  
published: 2015-09-21  
updated: 2015-09-21  
canonical: https://www.mindstick.com/forum/33464/best-way-to-save-data-on-the-iphone  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Best way to save data on the iPhone

I was creating an [iPhone application](https://www.mindstick.com/forum/23139/can-i-embed-a-custom-font-in-an-iphone-application) at the time of [coding](https://www.mindstick.com/articles/12290/teaching-coding-from-the-metal-up-or-from-the-glass-back) i need to save the state of my application.

My [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that the [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) persisting across upgrades. Some [applications](https://www.mindstick.com/articles/12847/how-to-choose-the-right-ethernet-cable-for-industrial-applications) that I was used clearly got this [wrong](https://answers.mindstick.com/qa/48468/who-wrote-the-the-wrong-enemy-america-in-afghanistan-2001-2014-and-when), and so I would not prefer them, so please give me suggestion.

## Replies

### Reply by Tarun Kumar

The simple way to do exactly this to save:

```
NSMyUser *obj = [NSMyUser myUser];[obj setObject:@"TextToSave" forKey:@"keyToFindText"];
```

To load:

```
NSMyUser *obj = [NSMyUser myUser];NSString *textToLoad = [obj stringForKey:@"keyToFindText"];
```

The important thing is that you do not store very large values in NSMyUser. There's a chance of getting in trouble with apple review if you do.\
Generally, user defaults is used for storing short keys and preferences such as the users volume level, wether they want to use game center, or send crash logs. \


---

Original Source: https://www.mindstick.com/forum/33464/best-way-to-save-data-on-the-iphone

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
