由于我最近更新到XCode 8 Beta 5,我一直试图在我的appDelegate核心数据堆栈中解决这个错误。'FileManager'类型的值没有成员'urlsForDirectory' - AppDelegate Swift 3错误
在这行代码,我得到了以下错误:
// MARK: - Core Data stack
lazy var applicationDocumentsDirectory: URL = {
// The directory the application uses to store the Core Data store file. This code uses a directory named "fitness.paceapp.Pace" in the application's documents Application Support directory.
let urls = FileManager.default.urlsForDirectory(.documentDirectory, inDomains: .userDomainMask)
return urls[urls.count-1]
}()
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
let modelURL = Bundle.main.urlForResource("Dominos", withExtension: "momd")!
return NSManagedObjectModel(contentsOf: modelURL)!
}()
什么可能会错过我的任何想法。我很迷茫,在那里没有太多答案。提前致谢。
你吃过看看新['FileManager' API参考(HTTPS: //developer.apple.com/reference/foundation/nsfilemanager)? – Hamish
[FileManager和urlsForDirectory错误在Swift 3 Xcode Beta 4中可能的重复](http://stackoverflow.com/questions/38754426/filemanager-and-urlsfordirectory-error-in-swift-3-xcode-beta-4) –