有什么方法可以知道自定义对象何时完成从对象文件内部初始化?或者让我换个说法,为什么我不能在这个方法中调用任何方法?
- (id)initWithCoder:(NSCoder *)coder {
//NSLog(@"initWithCoder inside CustomObject (subclass of UIView)");
self = [super initWithCoder:coder];
if (self) {
//... initialization here
[self visibleEmptyButton]; //why does this method never get called?
}
return self;
}
编辑:
-(void)viewDidLoad{
NSLog(@"viewDidLoad inside CustomObject(subclass of UIView) is called"); //It never gets called
[self viewDidLoad];
//initialization here...
}