My class is subclass of UIImageView. I create my custom initializer like this
@interface FishView : UIImageView
@end
@implementation FishView
- (id)initWithFishType:(FishType)fishType {
self = [super init];
if (self) {
//my custom initialization
}
return self;
}
是否有必要凌驾于无私状态?
- (id)initWithImage:(UIImage)image
{
self = [super initWithImage:image];
if (self) {
[self initWithFishType:FTNone];
}
return self;
}