Я добавил UIButton и UITextView в качестве подпредставлений к моему представлению программно.
notesDescriptionView = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,460)];
notesDescriptionView.backgroundColor = [UIColor redColor];
[self.view addSubview:notesDescriptionView];
textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,320,420)];
[self.view addSubview:textView];
printf("\n description button \n");
button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button
addTarget:self action:@selector(cancel:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"OK" forState:UIControlStateNormal];
button.frame = CGRectMake(80.0, 420.0, 160.0, 40.0);
[self.view addSubview:button];
Мне нужно удалить все подпредставления при нажатии кнопки.
Я пробовал:
[self.view removeFromSuperView]
но это не работает.