OSDN Git Service

Resign forcus on SinglePasswordDialog.
authorHirami <tomohisa.hirami@nifty.com>
Wed, 11 Apr 2012 13:25:12 +0000 (22:25 +0900)
committerHirami <tomohisa.hirami@nifty.com>
Wed, 11 Apr 2012 13:25:12 +0000 (22:25 +0900)
iOS/Tombo/Tombo/SinglePasswordDialog.m

index 45dfeff..75b1d30 100644 (file)
 
 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
     finished = YES;
+    UITextField *field = [self textFieldAtIndex:0];
     if (buttonIndex == 0) {
         // Cancel
         self.password = nil;
     } else if (buttonIndex == 1) {
         // OK
-        UITextField *field = [self textFieldAtIndex:0];
         NSString *pw = [field.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
         if (pw.length == 0) {
             self.password = nil;
@@ -41,6 +41,7 @@
             self.password = pw;
         }
     }
+    [field resignFirstResponder];
 }
 
 @end