I’m looking for some guidance/code-snippets/tutorial on passing some simple data into my app.
I have some data in a text file at the moment.
Name,Age,Weight
Name,Age,Weight
etc, etc,etc
There is not much. It will be read only since i wont need to change it.
How can i go about reading this into my app? What do you recommend? Nothing to difficult please, as I am still learning and advanced topics are still scary. Doesnt need to be fast or awesome etc. Just work and simple to understand.
Can iphone apps parse text files that are stored in the app bundle?
Many Thanks,
Code
You can get a path to the file like this:
And then load it into a string like this:
You can then use the split functions of NSString to split the data in lines and then in individual items.
Give it a try, if it does not work, post some code here.