list of questions to store

Discussion in 'iOS Programming' started by lsu420luv, Jul 23, 2009.

  1. lsu420luv macrumors newbie

    Jul 23, 2009
    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
  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    Your problem sounds like a good fit for an SQLite database.
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    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.
  4. lsu420luv thread starter macrumors newbie

    Jul 23, 2009
    thanks for the help i think i am going to use a plist

Share This Page