小编Lee*_*Lee的帖子

致命错误:init(编码器:)尽管已实现但尚未实现错误

我收到一条错误消息:

致命错误:init(编码器:)尚未实现

为我的习惯UITableViewCell.单元格未注册,故事板中具有标识符单元格以及使用dequeasreusablecell时.在自定义单元格中,我有以下内容:

码:

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    print("test")
    super.init(style: style, reuseIdentifier: reuseIdentifier)
}

required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}
Run Code Online (Sandbox Code Playgroud)

但我仍然有错误.谢谢.

uitableview ios swift

46
推荐指数
2
解决办法
4万
查看次数

UIUserNotificationSettings的Swift 3.0语法更改

我正在使用swift 3.0,我正在尝试将徽章编号添加到我的应用程序中.我相信这样做的正确方法类似于下面的内容.

application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Alert |
            UIUserNotificationType.Badge, categories: nil
            ))

application.applicationIconBadgeNumber = 5
Run Code Online (Sandbox Code Playgroud)

但是,使用"|"时出错 在UIUserNotificationSettings块中并且还将收到错误"参数标签(forTypes,categories)与任何可用的重载都不匹配",UIUserNotificationSettings如果我只有UIUserNotificationType.badge第一个参数.swift 3.0是否更改了此语句的语法?

uikit ios swift

14
推荐指数
2
解决办法
1万
查看次数

标签 统计

ios ×2

swift ×2

uikit ×1

uitableview ×1