1 2 3 4 5 6 7 8 9 10 11 12 13
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Authentication" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Sign In",nil];

[alertView addTextFieldWithValue:@"" label:@"Username"];
[alertView addTextFieldWithValue:@"" label:@"Password"];

[alertView textFieldAtIndex:1].secureTextEntry = YES;

[[alertView textFieldAtIndex:0] performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:0.05];

[alertView show];
[alertView autorelease];