遵循规则:
构造先父类后子类
析构先子类后父类
所以,自定义的init函数需要首先[super init....] dealloc中[super dealloc]却是放在最后的
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)dealloc {
[textEntered release];
[super dealloc];
}