I have 2 UITextFields inside a UIAlertView like so:
The issue that I am having is that I can't seem to get password or username (both NSStrings) to store the values of the text fields. What am I doing wrong?
Code:
UIAlertView *firstTimeWelcome = [[UIAlertView alloc]
initWithTitle: @"Welcome!"
message:@"Please enter your details:"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Continue", nil];
[firstTimeWelcome addTextFieldWithValue:@""label:@"Username"];
[firstTimeWelcome addTextFieldWithValue:@""label:@"Password"];
// Name field
UITextField *tf = [firstTimeWelcome textFieldAtIndex:0];
tf.clearButtonMode = UITextFieldViewModeWhileEditing;
tf.keyboardType = UIKeyboardTypeAlphabet;
tf.keyboardAppearance = UIKeyboardAppearanceAlert;
tf.autocapitalizationType = UITextAutocapitalizationTypeNone;
tf.autocorrectionType = UITextAutocorrectionTypeNo;
username = tf.text;
//Password Field
tf = [firstTimeWelcome textFieldAtIndex:1];
tf.clearButtonMode = UITextFieldViewModeWhileEditing;
tf.keyboardType = UIKeyboardTypeAlphabet;
tf.secureTextEntry = YES;
tf.keyboardAppearance = UIKeyboardAppearanceAlert;
tf.autocapitalizationType = UITextAutocapitalizationTypeNone;
tf.autocorrectionType = UITextAutocorrectionTypeNo;
password = tf.text;
[firstTimeWelcome show];
[firstTimeWelcome release];
The issue that I am having is that I can't seem to get password or username (both NSStrings) to store the values of the text fields. What am I doing wrong?