I would suggest using a plist rather than XML. Plists are easier to create and easier to read.
In either case though, putting your questions and answers into an external file makes your program flexible, without much effort. Then, if you decide later you want to have 50 questions, you just add records to your file.
I would suggest an array of dictionaries. You could create it like this:
#define K_QUESTION_KEY @"question"
#define K_ANSWERS_KEY @"answers"
#define K_CORRECT_ANSWER_INDEX @"answerIndex"
NSArray *questions = @[
@{K_QUESTION_KEY: @"What is your quest",
K_ANSWERS_KEY: @[@"I seek truth and enlightenment",
@"I seek to escape from reality",
@"I seek the Holy Grail"];
K_CORRECT_ANSWER_INDEX: @(2)
},
@{K_QUESTION_KEY: @"What is your favorite color",
K_ANSWERS_KEY: @[@"Blue",
@"Red",
@"Blue - no, green!"];
K_CORRECT_ANSWER_INDEX: @(1)
},
@{K_QUESTION_KEY: @"What is the airspeed velocity of an unladen swallow",
K_ANSWERS_KEY: @[@"42",
@"I don't know",
@"A European or African swallow?"];
K_CORRECT_ANSWER_INDEX: @(2)
}
];
Then write it to disk using
[questions writeToFile: file_path atomically: YES];
Then you'd use similar syntax to read the file and traverse through it.