У меня UIAlertview с UITextField в этом. Мое приложение для iPad
-(void)showAlertToAddLink
{
alertToAddLink =[[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"ADD", nil];
alertToAddLink.tag = 2;
alertToAddLink.alertViewStyle = UIAlertViewStylePlainTextInput;
[txtLinkName setDelegate:self];
/*
UITextField *txtLinkName = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 50.0, 260.0, 50.0)];
[txtLinkName setDelegate:self];
// txtLinkName.text=@"";
[txtLinkName setFont:[UIFont fontWithName:@"Helvetica" size:17.0]];
[txtLinkName setTextColor:[UIColor colorWithRed:71.0/255.0 green:78.0/255.0 blue:80.0/255.0 alpha:1]];
[txtLinkName setBorderStyle:UITextBorderStyleRoundedRect];
[txtLinkName setBackgroundColor:[UIColor whiteColor]];
[txtLinkName setKeyboardAppearance:UIKeyboardAppearanceAlert];
[txtLinkName setAutocorrectionType:UITextAutocorrectionTypeNo];
[txtLinkName setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[txtLinkName setClearButtonMode:UITextFieldViewModeWhileEditing];
[txtLinkName setTextAlignment:UITextAlignmentLeft];
// [txtLinkName becomeFirstResponder];
[alertToAddLink addSubview:txtLinkName];
*/[alertToAddLink show];
}
Я пытался с
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
[alertToAddLink resignFirstResponder];
return YES;
}
Но просмотр оповещений не происходит.
Как это сделать