If you do not implement +bezierPath
method in your class then superclass implementation will be called that will create instance of UIBezierPath, not JWBezierPath.
In theory it is possible for factory methods in base class to create instances even if those methods won't be overridden, e.g. consider 2 options for factory method in BaseClass:
// Will create instance of child class even if method won't be overriden
+ (instancetype) someObject {
return [self new];
}
vs
// Will always create instance of base class
+ (BaseClass*) someObject {
return [BaseClass new];
}
However considering +bezierPath
declaration (+(UIBezierPath *)bezierPath
) and your evidence UIBezierPath class is not implemented that way and you have to implement +bezierPath
method in your cub class