Xcode 7 Beta Core Data Error

Trying to save user inputed data into a list to be called by by user at a later point. In the save command (at lines 60 & 67) in Xcode 7 beta, I'm receiving the following command: "Cannot invoke 'save' with an argument list of type '(nil)'" This worked in Xcode 6 and is really the only way I know how to do this, if theres a newer or better way please enlighten me!!

import UIKit
import CoreData
class MainVC: UIViewController {
   
    let context = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext
   
    var nItem : List? = nil
    @IBOutlet weak var entryItem: UITextField!
    @IBOutlet weak var entryNote: UITextField!
    @IBOutlet weak var entryQty: UITextField!
   
   
   
    override func viewDidLoad() {
        super.viewDidLoad()
       
        if nItem != nil {
            entryItem.text = nItem?.item
            entryNote.text = nItem?.note
            entryQty.text = nItem?.qty
           
        }
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        /
    }
    @IBAction func cancelTapped(sender: AnyObject) {
        dismissVC()
    }
   
   
   
    @IBAction func saveTapped(sender: AnyObject) {
       
        if nItem != nil {
            editItem()
        } else {
            newItem()
        }
       
       
        dismissVC()
    }
   
    func dismissVC() {
        navigationController?.popViewControllerAnimated(true)
   
    }
    func newItem() {
        let context = self.context
        let ent = NSEntityDescription.entityForName("List" , inManagedObjectContext: context)
       
        let nItem = List(entity: ent!, insertIntoManagedObjectContext: context)
       
        nItem.item = entryItem.text
        nItem.note = entryNote.text
        nItem.qty = entryQty.text
        context.save(nil)
    }
   
    func editItem() {
        nItem!.item = entryItem.text
        nItem!.note = entryNote.text
        nItem!.qty = entryQty.text
        context.save(nil)
    }
}

If you look in the NSManagedObjectContext header, you will see that save() has been updated to use the new Swift Error Handling


func save() throws


So now your code would say

do {try context.save()}
catch {}     // handle error, or ignore


or if you want the app to crash if an error is thrown, just

try! context.save()
Xcode 7 Beta Core Data Error
 
 
Q