我試圖將屬性添加到UIBezierPath
。所以我創建了一個名爲JWBezierPath
的子類。我想都還與數參數類方法速記,所以我創建的方法:返回父類對象的Objective-C類方法
+ (JWBezierPath *)bezierPathWithColor:(UIColor *)color {
JWBezierPath *path = [self bezierPath];
[path setColor:color];
return path;
}
的問題是,[self bezierPath]
不會返回的UIBezierPath
而不是我的子類的實例。我也試過用混凝土類:[JWBezierPath bezierPath]
我該如何解決這個問題?
你能告訴我你的.h文件嗎 – cromanelli
你想添加到'UIBezierPath'的什麼樣的屬性? –