【发布时间】:2014-09-27 11:55:55
【问题描述】:
在我的 Swift 代码中:
override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
let stringIdent = String(format: "section_1_%d", section)
return NSLocalizedString(stringIdent, comment: nil)
}
运行构建时显示错误:
类型“字符串”不符合协议 NilLiteralConvertible
这段代码在 Objective-C 中一直有效。
Swift 有什么问题?
【问题讨论】: