Received actions in file's owner


#1

showQuestion doesn’t show up in received actions. showAnswer does.

Can anyone help?

@interface QuizViewController : UIViewController
{
int currentQuestionIndex;

//The model objects
NSMutableArray *questions;
NSMutableArray *answers;

//The view objects - don't worry about IBOutlet - 
//we'll talk about it shortly
IBOutlet UILabel *questionField;
IBOutlet UILabel *answerField;

}
@interface QuizViewController : UIViewController
{
int currentQuestionIndex;

//THe model objects
NSMutableArray *questions;
NSMutableArray *answers;

//the view objects
IBOutlet UILabel *questionField;
IBOutlet UILabel *answerField;

}

  • (IBAction)showQuestion:(id)sender;
  • (IBAction)showAnswer:(id)sender;

@end


#2

I’m confused - are there two interface declarations here?


#3

I see. I was confused because the book shows the same block of code twice. The second time does not have the same comments and it does have the IBAction. I put both in.


#4

Hi CiancioC

I guess you didn’t read the book from the beginning.
The first few pages of the book are important pages to read.

Please read the section “Typographical Conventions”.
In this section the author explains that:

“All code blocks will be in fixed width font. Code that you need to type in is always bold.”

The exact example is there in fact.

So I suggest you read this section carefully and save yourself a lot of grief.

Cheers.