GBA002/Common/Extensions/NSManagedObjectContext+Conveniences.swift
Riley Testut bf70df6611 Adds basic support for saving + loading save states
Stores SaveState model objects with Core Data, and displays the available save states in SaveStatesViewController.

Currently, tapping + button creates a new save state, while tapping a collection view cell loads the save state, regardless of whether Save State or Load State was selected from the pause menu.
2016-02-08 13:55:27 -08:00

27 lines
485 B
Swift

//
// NSManagedObjectContext+Conveniences.swift
// Delta
//
// Created by Riley Testut on 2/8/16.
// Copyright © 2016 Riley Testut. All rights reserved.
//
import CoreData
extension NSManagedObjectContext
{
// MARK: - Saving -
func saveWithErrorLogging()
{
do
{
try self.save()
}
catch let error as NSError
{
print("Error saving NSManagedObjectContext: ", error, error.userInfo)
}
}
}