Getting to grips with iOS in order to recreate an app I wrote for android. Basically the user picks a list of document titles from a table which leads to a new screen displaying the document itself as text in a scrolling view. These are static so can be bundled with the app. In the android version I used string arrays called titles[] and contents[] held in .xml files in the ‘values’ folder and read in using getResources() at run-time. When the user picked item n it moved to the next screen and displayed titles[n] and contents[n] in a pair of textViews. At the time it seemed inefficient to read 20 or 30 long text files into a string array just to display one of them, but it worked. The question is how best to do this in iOS. plist files seem closest to the previous approach but this doesn’t really lend itself to strings of several thousand characters. What is the best way to do this? A plist of titles and separate text files for the contents? Something glaringly obvious that I’m missing?
Thanks in advance, Andrew
Getting to grips with iOS in order to recreate an app I wrote for
Share
Unless I missed it I don’t see what your data source is. Regardless, Apple has a decent example of the data model you’re trying to mirror, TopSongs, which lays out a decent way to drill down into a data type to get more granular.
Part of your question seems to touch on statically storing the data within the app. There are a number of different ways to do this ranging from dumping out XML files to housing it all in a SQLLite db. Personally I think I would use a hybrid of both methods with the db referencing the individual files. Hope that helps.