Note that there are some explanatory texts on larger screens.

plurals
  1. POsetting the first responder view of the table but we don't know its type (cell/header/footer)
    primarykey
    data
    text
    <p>I have <strong>UITableViewController</strong>. In this controller I add a subview UIView with UITextField in it. When the UITextField get first responder got </p> <blockquote> <p>setting the first responder view of the table but we don't know its type (cell/header/footer)</p> </blockquote> <p>Code as below:</p> <pre><code>@interface UserAlbumListViewController (){ NSString *newAlbumName; UITextField *albumNameField; } @end -(void)addAlbumButtonPressed:(id)sender{ self.tableView.scrollEnabled = NO; CGRect frame = self.view.frame; UIView *opaqueView = [[UIView alloc] initWithFrame:frame]; opaqueView.tag = 1001; opaqueView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; UIView *controllerView = [[UIView alloc] init]; controllerView.tag = 1002; controllerView.backgroundColor = [UIColor whiteColor]; controllerView.frame = CGRectMake(10.0f, 60.0f, frame.size.width - 20.0f, 90.0f); [opaqueView addSubview:controllerView]; albumNameField = [[UITextField alloc] init]; albumNameField.borderStyle = UITextBorderStyleRoundedRect; albumNameField.placeholder = NSLocalizedString(@"Album Name",nil); albumNameField.keyboardType = UIKeyboardTypeDefault; albumNameField.returnKeyType = UIReturnKeyDefault; albumNameField.autocorrectionType = UITextAutocorrectionTypeNo; albumNameField.autocapitalizationType = UITextAutocapitalizationTypeNone; albumNameField.clearButtonMode = UITextFieldViewModeWhileEditing; albumNameField.clearsOnBeginEditing = NO; albumNameField.text = @""; albumNameField.frame = CGRectMake(10.0f , 10.0f, controllerView.frame.size.width - 20.0f, 30.0f); [albumNameField becomeFirstResponder]; [controllerView addSubview:albumNameField]; UIButton *_cancelButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; _cancelButton.backgroundColor = [UIColor clearColor]; [_cancelButton setTitle:NSLocalizedString(@"Cancel",nil) forState:UIControlStateNormal]; _cancelButton.frame = CGRectMake( controllerView.frame.size.width - 90.0f, albumNameField.frame.origin.y + albumNameField.frame.size.height + 10.0f, 80.0f, 30.0f); [_cancelButton addTarget:self action:@selector(opaqueViewCancelButtonClicked:) forControlEvents:UIControlEventTouchDown]; [controllerView addSubview:_cancelButton]; UIButton *_OKButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; _OKButton.backgroundColor = [UIColor clearColor]; [_OKButton setTitle:NSLocalizedString(@"OK",nil) forState:UIControlStateNormal]; _OKButton.frame = CGRectMake( _cancelButton.frame.origin.x - 90.f, _cancelButton.frame.origin.y, 80.0f, 30.0f); [_OKButton addTarget:self action:@selector(opaqueViewOKButtonClicked:) forControlEvents:UIControlEventTouchDown]; [controllerView addSubview:_OKButton]; [self.view addSubview:opaqueView]; [controllerView release]; [opaqueView release]; } </code></pre> <p>How to avoid this warning?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload