Gabriel Vincent Postado 26 de novembro de 2010 Denunciar Compartilhar Postado 26 de novembro de 2010 (editado) Já vi que é possível, e já consegui aplicar, mas não consigo utilizar o valor digitado no TextField do AlertView... Bom, aí está o código, pra quem quiser ver: - (IBAction)buttonPressed:(id)sender{ UIAlertView *alert = [[[UIAlertView alloc]initWithTitle:@"Enter password" message:@" " delegate:self cancelButtonTitle:@"Add" otherButtonTitles:@"Cancel",nil]autorelease]; UITextField *tagField = [[[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)] autorelease]; // tagField. tagField.backgroundColor = [UIColor whiteColor]; tagField.tag = 10; tagField.keyboardType = UIKeyboardTypeAlphabet; tagField.secureTextEntry = YES; [alert show]; [alert addSubview:tagField]; /*if (tagField.text = "Un1v3rs0") { lockView.hidden = NO; unlockView.hidden = YES; } */ } - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex { //the add button UITextField *tagName = (UITextField*)[alertView viewWithTag:10]; if(buttonIndex == 0) { if(tagName.text != nil) { // do some tag adding } } [tagName removeFromSuperview]; } Obrigado pela atenção! Editado 26 de novembro de 2010 por Gabriel Vincent Citar Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados
Participe do debate
Você pode postar agora e se registrar depois. Se você tem uma conta, entre agora para postar com ela.