NSString *dbFilePath = [[NSBundle mainBundle]
pathForResource:@"dictionary"
ofType:@"db"];
Saturday, February 21, 2009
Load a file on the iPhone
If your application has settings or data stored in a file/database, you can't just load the file normally as you would in C/C++ in the current directory. First, to get a file on to the phone, it needs to be stored in the App bundle. This is accomplished by placing the file in the "Resources" directory of the XCode project. Files are stored on the phone in an application's bundle, so you need to query the iPhone for the path to your file. The following code will accomplish that for a file, "dictionary.db".
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment