How is my logic here...
For each quiz question, there will be a selection of answers, feedback and an image. I have therefore created a class called Content with those properties:
However, I just watched a lecture from Stanford University on iTunes, and the lecture was talking about retrieving an array of dictionaries from Flickr to work with.
I presume the dictionaries would contain objects like photo name, photo description, Image, with keys for each. But why have an array of dictionary's? Why not have it set up like I have done above?
I'm struggling to understand these concepts. Please help.
For each quiz question, there will be a selection of answers, feedback and an image. I have therefore created a class called Content with those properties:
Code:
NSMutableDictionary *totalContent = [NSMutableDictionary dictionaryWithCapacity:1];
Content *page1 = [[content alloc] init];
page1.questionName = @"This is question 1";
page1.answer1 = @"This is answer 1";
page1.answer2 = @"This is answer 2";
etc
[totalContent addObject:page1 forKey:@"first"];
However, I just watched a lecture from Stanford University on iTunes, and the lecture was talking about retrieving an array of dictionaries from Flickr to work with.
I presume the dictionaries would contain objects like photo name, photo description, Image, with keys for each. But why have an array of dictionary's? Why not have it set up like I have done above?
I'm struggling to understand these concepts. Please help.
Last edited: