当我尝试将 UITextField 的委托设置为 UIView 类时,出现 sigabrt 错误。我使用了 UITextFieldDelgate 协议。这是我的代码
nameField = [[UILabel alloc] initWithFrame:CGRectMake(130, 40, 200, 30)];
[nameField setDelegate:self];
nameField.placeholder = @"<Game Name>";
nameField.textAlignment = UITextAlignmentCenter;
[self addSubview:nameField];