Created
March 8, 2018 04:11
-
-
Save FromNowOn2017/3196a7bfca82fe0b0bdb42fab91c5121 to your computer and use it in GitHub Desktop.
コアデータを作成した際のエラーについてです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Value of type 'AppDelegate' has no member 'hogehoge' | |
こんなエラーが出た際には確認して見ましょう! | |
AppDelegate | |
// MARK: - Core Data stack | |
lazy var persistentContainer: NSPersistentContainer = { | |
let container = NSPersistentContainer(name: "dotStick") | |
container.loadPersistentStores(completionHandler: { (storeDescription, error) in | |
if let error = error as NSError? { | |
fatalError("Unresolved error \(error), \(error.userInfo)") | |
} | |
}) | |
return container | |
}() | |
// MARK: - Core Data Saving support | |
func saveContext () { | |
let context = persistentContainer.viewContext | |
if context.hasChanges { | |
do { | |
try context.save() | |
} catch { | |
let nserror = error as NSError | |
fatalError("Unresolved error \(nserror), \(nserror.userInfo)") | |
} | |
} | |
} | |
コアデータの記載漏れがあるかもしれないです。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment