rt300@14: // rt300@14: // QuestionnaireViewController.m rt300@14: // oscSenderExample rt300@14: // rt300@14: // Created by Robert Tubb on 16/01/2013. rt300@14: // rt300@14: // rt300@14: rt300@14: #import "QuestionnaireViewController.h" rt300@14: rt300@14: @interface QuestionnaireViewController () rt300@14: // the "model" is an array of questions rt300@14: @property (strong, nonatomic) NSArray * questionArray; rt300@14: @property (strong, nonatomic) NSArray * answerArray; rt300@14: @property (nonatomic) NSInteger currentQuestionIndex; rt300@14: /* rt300@14: @"I am familiar with music software and synthesisers." rt300@14: @"The best way to get a feel for the possibilities of the synth was with:" rt300@14: @"Interesting sounds could be discovered more quickly as a result of using:" rt300@14: @"A sound could be fine tuned more easily using:" rt300@14: @"The correspondence between the sliders and the grid was understandable." rt300@14: @"The interface that felt more familiar was:" rt300@14: @"Scrolling a greater distance the zoom grid seemed to correspond to larger difference in the sound." rt300@14: @"The ability to see other presets on the grid was useful." rt300@14: @"The range of sounds was too limited to be able to judge the eventual usefulness of the interface." rt300@14: @"The interface better for generating new ideas was" rt300@14: @"The interface better for live performance would be:" rt300@14: @"A specific type of sound could be found more quickly using:" rt300@14: @"I felt more in control when using:" rt300@14: @"The Zoomer was an improvement on just using the randomiser." rt300@14: @"The combination of Zoomer and Sliders was more useful than either individually." rt300@14: @"Overall, I preferred using:" rt300@14: rt300@14: */ rt300@14: rt300@14: @end rt300@14: rt300@14: @implementation QuestionnaireViewController rt300@14: rt300@14: //---------------------------------------------------------------- rt300@14: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil rt300@14: { rt300@14: self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; rt300@14: if (self) { rt300@14: // Custom initialization rt300@14: rt300@14: [self populateQuestionArray ]; rt300@14: rt300@14: rt300@14: } rt300@14: return self; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (void)viewDidLoad rt300@14: { rt300@14: [super viewDidLoad]; rt300@14: // Do any additional setup after loading the view from its nib. rt300@14: self.currentQuestionIndex = 0; rt300@14: // load question 1 rt300@14: [self loadQuestion:self.currentQuestionIndex]; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (void)didReceiveMemoryWarning rt300@14: { rt300@14: [super didReceiveMemoryWarning]; rt300@14: // Dispose of any resources that can be recreated. rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (void)dealloc { rt300@14: [_answerPressed release]; rt300@14: [_questionText release]; rt300@14: [super dealloc]; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (void)viewDidUnload { rt300@14: [self setAnswerPressed:nil]; rt300@14: [self setQuestionText:nil]; rt300@14: [super viewDidUnload]; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (IBAction)answerWasSelected:(id)sender { rt300@14: // look at property? rt300@14: rt300@14: } rt300@14: rt300@14: //---------------------------------------------------------------- rt300@14: -(IBAction)hide:(id)sender{ rt300@14: self.view.hidden = YES; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: -(IBAction)show:(id)sender{ rt300@14: self.view.hidden = NO; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: rt300@14: - (IBAction)nextQuestionPressed:(id)sender { rt300@14: // save answer ? no button did that hopefully rt300@14: // if last question show thanks rt300@14: rt300@14: // else go to next rt300@14: self.currentQuestionIndex++; rt300@14: [self loadQuestion:self.currentQuestionIndex]; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (void)loadQuestion:(NSInteger)questionIndex { rt300@14: // populate text fields with question rt300@14: self.questionText.text = [self.questionArray objectAtIndex:questionIndex]; rt300@14: rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: - (void)populateQuestionArray{ rt300@14: self.questionArray = [[NSArray alloc] initWithObjects:@"one", @"two", @"buckle", nil]; rt300@14: } rt300@14: //---------------------------------------------------------------- rt300@14: rt300@14: @end // end implementation