Swift - 类型的值'(NSObject) - > () - > NotesListViewController'没有成员堆栈?

时间:2016-09-22 08:02:48

标签: swift3 ios10 xcode8

我编写自己的CoreDataStack文件,当我编译项目时,收到警告“Swift - 类型的值”(NSObject) - >() - > NotesListViewController'没有成员堆栈?“

class NotesListViewController: UITableViewController, NSFetchedResultsControllerDelegate {

    var stack: CoreDataStack = CoreDataStack(modelName:"UnCloudNotesDataModel", storeName:"UnCloudNotes")

    lazy var notes: NSFetchedResultsController = { (_) -> NSFetchedResultsController<NSFetchRequestResult> in
        var request = NSFetchRequest<NSFetchRequestResult>(entityName: "Note")
        request.sortDescriptors = [NSSortDescriptor(key: "dateCreated", ascending: false)]
        var notes = NSFetchedResultsController(fetchRequest: request, managedObjectContext: self.stack.context, sectionNameKeyPath: nil, cacheName: nil)
        notes.delegate = self
        return notes
    }()

0 个答案:

没有答案