I want to parse and XML file in an iPhone app without going to disk for it. Can I do this? How? I have included a TXT helpfile in an app using MSVC.
I put the XML file in a Folder/Group named Resources in the project.
I have the XML file in the proj directory.
I right clicked on Resources folder and selected add -> Existing File.
I right-click on the XML file and select GetInfo.
There I have tried altering the Path Type {Absolute, Relative to Project , etc}
My program runs fine on the simulator when I use:
NSString * const DG_XmlRecipeFile = @'/Users/appleuser/Cocoa/iHungry6/Recipes.xml';
It seems to me it should also work with:
NSString * const DG_XmlRecipeFile = @'Recipes.xml';
If I set the Path Type correctly. It does not.
I am a first timer. Thanks for reading this , Mark
Xcode copies the project resources to the app bundle. You can access your file within your bundle as follows:
Files in the bundle are read-only. If you want to modify the file you will need to copy it somewhere that you can modify it. Your app’s Documents directory works well for this.