I’m new to iOS and Objective-C myself, but I think (and someone can certainly correct me if I am wrong) that either way works. If you go back to your header file, you’ve already created the pointers to those objects:
[code]@interface QuizAppDelegate : NSObject
// The model objects
// The view objects
IBOutlet UILabel *questionField;
IBOutlet UILabel *answerField;
You create the instance variables (in this case questions, answers, questionField, and answerField) in your header file, and then you can make reference to it in the implementation file. You can’t declare it in the header and then try to recreate it in the implementation. i.e. the following would not work:
NSMutableArray *questions = [[NSMutableArray alloc] init];
NSMutableArray *answers = [[NSMutableArray alloc] init]
This is because you’ve already created pointers named questions and answers in your header file, thus you can’t create the same pointer with the same name again in the implementation file.
So, as for why it’s in the header file at all and not just in the implementation file…I believe that has something to do with Objective-C and how it creates public/private/protected variables. Creating a variable in just the .m file and not the .h file gives it a different level of access I think. Hope this helps!