How to get DateSectionTitles using FetchedResultsController in Swift 4

六眼飞鱼酱① 提交于 2019-12-05 21:35:40

The key path passed to the sectionNameKeyPath: argument of the fetched results controller must be visible to the Objective-C runtime. In Swift 4 that requires an explicit annotation with @objc (compare also How can I deal with @objc inference deprecation with #selector() in Swift 4?):

extension completedNotes {
    @objc var sectionIdentifier : String? { 
        // ...
    }
}

Without that, the section name key path is silently ignored.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!