iOS - Recommended location of application support files

Posted on 2012-08-31
Medium Priority
Last Modified: 2012-08-31
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?
Question by:efz
  • 3
  • 2
LVL 15

Accepted Solution

Hamidreza Vakilian earned 2000 total points
ID: 38354644
The best way is to create a directory (e.g. "Private Documents") in Library directory in app's bundle.
Similar question here:

Author Comment

ID: 38354763
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") ?
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38355638
In fact the difference is that URLForDirectory is not available in iOS < 4 but NSSearchPathForDirectoriesInDomains is available in iOS 2+.

Author Comment

ID: 38356048
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?
LVL 15

Expert Comment

by:Hamidreza Vakilian
ID: 38356128
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


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
     Intro      In this article, I will show you how to parse a JSON in Swift using an open source library called SwiftyJSON (https://github.com/SwiftyJSON/SwiftyJSON). If you haven't heard of a JSON before, it stands for JavaScript Object Notation…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Integration Management Part 2
Suggested Courses

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question