He agregado UIButton, UITextView como subvista a mi vista, programáticamente.cómo eliminar vistas secundarias
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];
aquí si hacemos clic en el botón, necesito eliminar todos los puntos de vista sub,
estoy tratando
[self.view removeFromSuperView]
pero no su trabajo
ninguna ayuda.
¿qué ocurre con el botón, he creado, al agregar como sub-vista. en realidad estoy tratando de mostrar una vista con vista de texto, cuando se presiona el botón, después cuando hago clic en el otro botón que está en la vista actual, tiene que volver a mi vista anterior. – mac
intenté [notesDescriptionView removeFromSuperview]; [textView removeFromSuperview]; pero no está funcionando. – mac
¿Cuál es la forma correcta de llamar a un método de este tipo que elimina la subvista de la supervista de otra clase? Estoy intentando delegar método pero no funciona. – SanitLee