0

I heard in this TUAW Article that iPhone apps should stop using the Documents folder to store files. Instead they should use the library folder. How do you access the Library folder to store files to it?

Thanks in advance!

Mark Szymanski
  • 56,590
  • 24
  • 70
  • 87
  • 2
    It should also be noted that only the Documents directory and the Library/Preferences directory are guaranteed to be maintained when you update your application. So you should be careful that anything not placed in the Documents directory is something that can easily be recreated without the user losing any data. – Jason Coco Apr 27 '10 at 01:07

1 Answers1

5

Use the NSLibraryDirectory constant instead of the NSDocumentDirectory constant when you call NSSearchPathForDirectoriesInDomains. You would only have to worry about this if you actually do plan on writing an application that allows users to manage documents.

Jason Coco
  • 77,985
  • 20
  • 184
  • 180
  • I updated the community wiki for iPhone writable directories here to reflect use of NSLibraryDirectory: http://stackoverflow.com/questions/1567134/how-can-i-get-a-writable-path-on-the-iphone/1567147#1567147 – Kendall Helmstetter Gelner Apr 27 '10 at 03:13