View Full Version : list of questions to store
lsu420luv
Jul 23, 2009, 01:13 PM
what would be the best way to store a list of questions and then the answers? I was thinking of just creating a text file and loading them into an array of NSSTring's by each line? is this the best way
firewood
Jul 23, 2009, 01:42 PM
Your problem sounds like a good fit for an SQLite database.
PhoneyDeveloper
Jul 23, 2009, 01:43 PM
Depends on what 'best' means.
How many questions do you have?
Do the questions and answers have exactly the same format (same number of choices etc.)?
Will you want to update these questions at some point? From the internet?
What technologies to you already know and which are you willing to learn?
The obvious choices are:
a simple text file format
plist file
xml file
sqlite database
html file that has the text of the question already in it
directory of files where each text file has the text of one question in it
compile the questions and answers into your app as a data structure made up of static strings or as components of an array of structs
For a modest number of questions I would most likely use the plist file. I would build the file in code from a set of strings.
lsu420luv
Jul 23, 2009, 01:52 PM
thanks for the help i think i am going to use a plist
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.