【发布时间】:2010-10-26 09:16:05
【问题描述】:
我想要一个枚举作为我的函数的参数。这行得通吗?
(UIFont*) myMethodName:(UITableViewCellStyle) cellStyle {
//...
if (cellStyle == UITableViewCellStyleValue2)
// ...
}
那我就这样调用方法
UIFont *resultFont = [self myMethodName:UITableViewCellStyleSubtitle];
只应允许以下参数: UITableViewCellStyleDefault, UITableViewCellStyleValue1, UITableViewCellStyleValue2, UITableViewCellStyleSubtitle
有可能吗?
【问题讨论】:
标签: iphone objective-c cocoa-touch enums