ios - swift 2 错误 : Editor placeholder in sourcefile

标签 ios xcode swift

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{

    let cell: UITableViewCell = UITableViewCell(style: <#T##UITableViewCellStyle#>.Subtitle, reuseIdentifier: "test")

我一直收到错误 editor placeholder in source file。 我还收到错误 Static member 'Subtitle' cannot be used on instance of type 'UITableViewCellStyle'

最佳答案

您的文件中有一个编辑器占位符(编译器很好地指出了这一点)。将错误行改成这样:

let cell: UITableViewCell = UITableViewCell(style: .Subtitle, reuseIdentifier: "test")

关于ios - swift 2 错误 : Editor placeholder in sourcefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35528631/

相关文章:

objective-c - 使用来自异步 NSURLConnection 的数据填充 NSImage

ios - 为 AWS AppSync 客户端 iOS Swift 启用缓存

android - InAppPurchase ios 电话间隙

ios - 以编程方式在 UISplitViewController 中显示主视图上的幻灯片

ios - 在 swift 类中使用 Pushkit 而不是 AppDelegate

swift - 无法在 Swift 中从该设备复制符号

ios - 如何在 iOS 模拟器上创 build 备商店的 URL

ios - UITableView 重叠单元格(力)

json - 如何从 XCUITest 读取 Json 文件?

objective-c - Xcode 无法导入 tapku 或 kal 库