2類和派生包含的方法 像調用靜態函數在超類
interface class base:NSObject{
+(int)getmaxrow{
return 30;
}
+display{
print [getmaxrow]; ///here is the :(how to call getmaxrow so
///that it should wrk perfectly on derived aswell as base
}
}
interface class derived: base{
+(int)getmaxrow{
return 45;
}
}
在這裏,我們需要一個適當的方法源自調用,這樣就應該日overrided方法
也許'[自doStuff
和
[[自類] getmaxrow]
用於呼叫]'? – 2013-04-24 11:48:06
自己不能使用靜態方法 – user1844112 2013-04-24 11:50:09
@ user1844112,可能不是這種語言,它是什麼。但在Objective-C中可以。 – vikingosegundo 2013-04-24 11:50:44