I have My own UIView :
#import <UIKit/UIKit.h>
@interface MultipleSlotsClientView : UIView
-(IBAction)didPressCloseBtn:(id)sender;
@end
And this is the implementation:
@implementation MultipleSlotsClientView
- (id)initWithFrame:(CGRect)frame {
self = [[[[NSBundle mainBundle] loadNibNamed:@"MultipleSlotsClientView" owner:self options:nil] objectAtIndex:0] retain];
if (self) {
self.frame = frame;
}
return self;
}
#pragma mark
#pragma mark IBAction
-(IBAction)didPressCloseBtn:(id)sender {
[self removeFromSuperview];
}
@end
And i have a btn that connect to the didPressCloseBtn method and when i press the button the method called but the View won't remove from the superview.
This is how i alloc the UIView and add it:
MultipleSlotsClientView *multiView = [[[MultipleSlotsClientView alloc] initWithFrame:self.view.frame] autorelease];
[self.view addSubview:multiView];
Any idea why the view won't disappear?

didPressCloseBtnis placed? insideMultipleSlotsClientViewor inside other viewcontroller where you are addingMultipleSlotsClientView? - Vaibhav Saran