Mercurial > hg > soniczoomios
comparison UsernameAlertViewController.mm @ 47:0d3a993405e4
trying rto stop duplictae symbols
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 01 May 2013 16:47:11 +0100 |
parents | 3d627dce8bf0 |
children |
comparison
equal
deleted
inserted
replaced
46:1e266647840d | 47:0d3a993405e4 |
---|---|
26 UITextField * alertTextField = [self.alert textFieldAtIndex:0]; | 26 UITextField * alertTextField = [self.alert textFieldAtIndex:0]; |
27 [alertTextField setDelegate:self]; | 27 [alertTextField setDelegate:self]; |
28 alertTextField.keyboardType = UIKeyboardTypeDefault; | 28 alertTextField.keyboardType = UIKeyboardTypeDefault; |
29 alertTextField.placeholder = @"Username"; | 29 alertTextField.placeholder = @"Username"; |
30 [self.alert show]; | 30 [self.alert show]; |
31 //[self.alert release]; | 31 [self.alert release]; |
32 | 32 |
33 | 33 |
34 } | 34 } |
35 -(void)setAppRef:(id)theAppRef{ | 35 -(void)setAppRef:(id)theAppRef{ |
36 self.theOFAppRef = theAppRef; | 36 self.theOFAppRef = theAppRef; |
43 if ([userName isEqualToString:@""]){ | 43 if ([userName isEqualToString:@""]){ |
44 [self showUserNamePrompt]; | 44 [self showUserNamePrompt]; |
45 return; | 45 return; |
46 } | 46 } |
47 eventLogger.setUsername([userName cStringUsingEncoding:NSASCIIStringEncoding]); | 47 eventLogger.setUsername([userName cStringUsingEncoding:NSASCIIStringEncoding]); |
48 [userName release]; | |
48 ((testApp *)self.theOFAppRef)->startTimedSession(); | 49 ((testApp *)self.theOFAppRef)->startTimedSession(); |
49 | 50 |
50 | 51 |
51 } | 52 } |
52 | 53 |
59 | 60 |
60 }else{ | 61 }else{ |
61 eventLogger.setUsername([userName cStringUsingEncoding:NSASCIIStringEncoding]); | 62 eventLogger.setUsername([userName cStringUsingEncoding:NSASCIIStringEncoding]); |
62 | 63 |
63 } | 64 } |
65 [userName release]; | |
64 [self.alert dismissWithClickedButtonIndex:self.alert.firstOtherButtonIndex animated:YES]; | 66 [self.alert dismissWithClickedButtonIndex:self.alert.firstOtherButtonIndex animated:YES]; |
65 return YES; | 67 return YES; |
66 } | 68 } |
67 | 69 |
68 - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView | 70 - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView |
69 { | 71 { |
70 UITextField *textField = [alertView textFieldAtIndex:0]; | 72 UITextField *textField = [alertView textFieldAtIndex:0]; |
71 if ([textField.text length] == 0) | 73 if ([textField.text length] == 0) |
72 { | 74 { |
75 [textField release]; | |
73 return NO; | 76 return NO; |
74 } | 77 } |
78 [textField release]; | |
75 return YES; | 79 return YES; |
76 } | 80 } |
77 | 81 |
78 | 82 |
79 @end | 83 @end |