I'm finishing IOS Swift Tutorial "FoodTracker", but there's a error that I can find solution and I dont understand what is wrong and how to fixit:
The error:
Value of tuple type '()' has no member 'path'
This error is shown for variable "Meal.ArchiveUrl.path" at below code.
My code, at MealtableViewController (that its equal to IOS tutorial):
private func saveMeals(){
let isSuccessfulSave = NSKeyedArchiver.archiveRootObject(meals, toFile: Meal.ArchiveUrl.path )
if isSuccessfulSave {
os_log("Meals successfully saved.", log: OSLog.default, type: .debug)
} else {
os_log("Failed to save meals...", log: OSLog.default, type: .error)
}
}
And at Meal.swift, there's the declaration:
/MARK: Archiving Paths
static let DocumentsDirectory = FileManager().urls(for: .documentDirectory, in: .userDomainMask).first!
static let ArchiveUrl = DocumentsDirectory.appendingPathComponent("meals")
Somebody could help me with this, please?