I am trying to use removeFromSuperView with a UITextView Object but it is giving me the following error:
No visible @interface for 'UITextField' declares the selector 'removeFromSuperView'
This seems strange since UITextField is a subclass of UIView, so it should inherit the removeFromSuperView method. I have tried the same method for buttons and it works great. Here is how I am calling it:
[self.exitButton removeFromSuperview];
[self.teacherText removeFromSuperView];
I set up my UITextField programmatically, it is declared as follows:
in .h:
@property(nonatomic, copy) UITextField *teacherText;
in viewDidLoad of .m:
_teacherText = [[UITextField alloc] initWithFrame:CGRectMake(45, 30, 200, 40)];
_teacherText.textColor = [UIColor colorWithRed:0/256.0 green:84/256.0 blue:129/256.0 alpha:1.0];
_teacherText.font = [UIFont fontWithName:@"Helvetica-Bold" size:25];
_teacherText.backgroundColor=[UIColor whiteColor];
_teacherText.text=@"Hello World";
[self.view addSubview:_exitButton];
Is there anything I am missing?