报错:
libc++abi.dylib: terminate_handler unexpectedly threw an exception
原因是:
未调用父类initWithFrame:方法
- (id)initWithFrame:(CGRect)frame {
/**
* Description
* 未调用父类initWithFrame:方法(self = [super initWithFrame:frame];)
* 导致报错,程序卡死(libc++abi.dylib: terminate_handler unexpectedly threw an exception)
*/
//self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor redColor];
[self createSubViews];
}
return self;
}