Memory Management
问题 How is method removeFromSuperView: really works? I got a problem of memory bad access when I want to reinit the view - (id)init { if (!(self = [super init])) return nil; _mainView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; NSLog(@"retainCount :%d", [_mainView retainCount]); UIButton *reInitButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f,0.0f,90.0f,35.0f)]; [reInitButton addTarget:self action:@selector(buttonDidTapped:) forControlEvents