【发布时间】:2015-01-13 02:28:21
【问题描述】:
我正在尝试创建一个字符串扩展来做类似的事情
"My name is %@. I am %d years old".localizeWithFormat("John", 30)
看起来像这样
extension String {
func localizeWithFormat(arguments: CVarArgType...) -> String {
return String.localizedStringWithFormat(
NSLocalizedString(self,
comment: ""), getVaList(arguments))
}
}
它给了我以下编译错误
类型 CVaListPointer 不符合协议 CVargType
有人知道如何解决这个编译错误吗?
【问题讨论】:
标签: swift localization