iOS - Recommended location of application support files

In learning to program for the Mac OSX, I was advised to place application support files in a folder like:


I’m experimenting with converting a program from OSX to iOS, and I have no experience with iOS, but I’m aware that the iPad for instance has no hard drive, so what is the recommended location for support files?
Who is Participating?
Hamidreza VakilianConnect With a Mentor Senior iOS DeveloperCommented:
The best way is to create a directory (e.g. "Private Documents") in Library directory in app's bundle.
Similar question here:
efzAuthor Commented:
Please accept my sincere thanks for your speedy and excellent reply.

So the technique for locating directories on iOS isn't really any different than OSX, correct? For example, when programming for OSX in Delphi XE2/FireMonkey, I determine the user's Document directory by using the following line of code:

URL:=FileMgr.URLForDirectory(NSDocumentDirectory, NSUserDomainMask, nil, false,Error);

This returns the path to the user's Document directory (although I'm not sure what the difference is between "URLForDirectory" and "NSSearchPathForDirectoriesInDomains" which is used in the example you referred me to in your link).

Essentially, in my iOS code I would use the same line to find the Library directory (except using "MSLibraryDirectory") ?
Hamidreza VakilianSenior iOS DeveloperCommented:
In fact the difference is that URLForDirectory is not available in iOS < 4 but NSSearchPathForDirectoriesInDomains is available in iOS 2+.
efzAuthor Commented:
Hey thanks much. I have one more question about your answer and then I'll cease and desist. In what module is the NSSearchPathForDirectoriesInDomains in? In other words, when I'm compiling for OSX, I use the MacAPI.Foundation module where everything's defined. This doesn't work in the Free Pascal Compiler, nor does MacAPI_Foundation. What is the correct corresponding module for the "uses" clause in iOS?
Hamidreza VakilianSenior iOS DeveloperCommented:
Im sorry; I have not any experience in developing iOS with Delphi & free pascal. you should take a look in their guides. Check this link:
Also try:
uses ios_files;

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.