我想有一個枚舉作爲我的函數的參數。這會工作嗎?是否有可能使用像UITableViewCellStyle這樣的枚舉作爲方法的參數?
(UIFont*) myMethodName:(UITableViewCellStyle) cellStyle {
//...
if (cellStyle == UITableViewCellStyleValue2)
// ...
}
然後我會打電話像這樣
UIFont *resultFont = [self myMethodName:UITableViewCellStyleSubtitle];
只有下面的參數應該被允許的方法: UITableViewCellStyleDefault, UITableViewCellStyleValue1, UITableViewCellStyleValue2, UITableViewCellStyleSubtitle
這可能嗎?
這就是我想知道的;) – testing 2010-10-26 09:23:49