diff Question.m @ 44:a1e75b94c505

Snap to eval points. Double tap to go to preset (doesn't quite work yet). Coloured locks. Changed Question 2. Fixed some leaks.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Mon, 22 Apr 2013 18:32:34 +0100
parents 79c129e500e1
children
line wrap: on
line diff
--- a/Question.m	Fri Apr 19 18:50:04 2013 +0100
+++ b/Question.m	Mon Apr 22 18:32:34 2013 +0100
@@ -44,18 +44,19 @@
     if(type == AGREE_DISAGREE){
         [Question setCount:NUM_CHOICES];
         
-        // potential leak
-        return [[NSArray alloc] initWithObjects:
+        NSArray *answers =  [[[NSArray alloc] initWithObjects:
                      @"Strongly agree",@"Agree", @"Neither agree nor disagree",
-                     @"Disagree",@"Strongly disagree", nil];
-        
+                     @"Disagree",@"Strongly disagree", nil] autorelease];
+
+        return answers;
         
     }else if(type == SLIDERS_ZOOMER){
         [Question setCount:NUM_CHOICES];
-        // potential leak
-        return [[NSArray alloc] initWithObjects:
+        NSArray *answers =   [[[NSArray alloc] initWithObjects:
                  @"definitely the Sliders", @"maybe the Sliders", @"Neither/Both equal",
-                @"maybe the Zoomer", @"definitely the Zoomer", nil];
+                @"maybe the Zoomer", @"definitely the Zoomer", nil] autorelease];
+
+        return answers;
     }else{
         return nil;
     }