I am using the UIAlertView to show the text field over a popup. But the problem I am facing is that I am not able to validate and restrict the entries in UITextField over a popup, i.e. I want to accept only 3 numeric values.
Here i am providing the block of code that I have implemented.
popup = [[UIAlertView alloc] initWithTitle:@"Please enter 3 numeric values"
message:@"\n\n"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Ok", nil];
txtFld = [[UITextField alloc] initWithFrame:CGRectMake(12, 50, 260, 25)];
[txtFld setBackgroundColor:[UIColor whiteColor]];
[txtFld setKeyboardType:UIKeyboardTypeNumberPad];
[popup addSubview:txtFld];
[popup show];
[txtFld becomeFirstResponder];
So can anyone help me out to resolve this issue? Thanks in advance.
here I can see that you have not set textfield.delegate=self , please check it in your code