Search code examples
iospersistencetvosapple-tv

Can NSUserDefaults be used to persist data on tvOS?


According to the Apple Documentation:

"There is no persistent local storage for apps on Apple TV. This means that every app developed for the new Apple TV must be able to store data in iCloud and retrieve it in a way that provides a great customer experience."

Does this also exclude using NSUserDefaults as a means of persisting data?


Solution

  • According to an answer on Apple Developers Forum:

    NSUserDefaults is allowed, and supports up to 500KB of data.

    You can also store content locally using the application temp and cache directories, but note that this data will be purged.

    Beyond the above 500 KB limit, you will need to utilize either CloudKit or some other off device means of data storage. This could include your own web services implementation, for example.