Resolved UIAlertViews With TextFields

Discussion in 'iOS Programming' started by loon3y, Apr 9, 2012.

  1. loon3y, Apr 9, 2012
    Last edited by a moderator: Apr 9, 2012

    loon3y macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #1
    i want to add UITextFields in my alert view,


    I've used the UIAlertViewStyleLoginAndPasswordInput style, but i want to disable the hiding of the password characters as i type it in, because it is not going to be a login view, i just don't want to create the alertView from scratch.


    is there a way i can just disable that thing that hides the text characters into those circles? by just calling a method?
     
  2. loon3y thread starter macrumors 65816

    loon3y

    Joined:
    Oct 21, 2011
    #2
    Resolved:



    Code:
    - (void)showAlert
    {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Item Not Found" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        alertView.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
        UITextField *alertText = [alertView textFieldAtIndex:0];
        UITextField *itemText = [alertView textFieldAtIndex:1];
        alertText.text = lastBarcode;
        [itemText setPlaceholder:@"Enter Item #"];
        itemText.secureTextEntry = NO;
        
        
        [alertView show];
    }
     

Share This Page