import UIKit
import CoreData

class ViewController: UIViewController {
                            
    @IBOutlet var txtUsername: UITextField = UITextField()
    @IBOutlet var txtPassword: UITextField = UITextField()
    
    @IBAction func btnLoad(sender: UIButton) {
        var appDel:AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate
        var context: NSManagedObjectContext = appDel.managedObjectContext
    }
    
    @IBAction func btnSave(sender: UIButton) {
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}


//
//  ViewController.swift
//  CoreData
//
//  Created by Domenico Solazzo on 7/14/14.
//  Copyright (c) 2014 Domenico Solazzo. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
                            
    @IBOutlet var txtUsername: UITextField = UITextField()
    @IBOutlet var txtPassword: UITextField = UITextField()
    
    @IBAction func btnLoad(sender: UIButton) {
        var appDel:AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate
    }
    
    @IBAction func btnSave(sender: UIButton) {
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}


--- 
+++ 
@@ -1,12 +1,5 @@
-//
-//  ViewController.swift
-//  CoreData
-//
-//  Created by Domenico Solazzo on 7/14/14.
-//  Copyright (c) 2014 Domenico Solazzo. All rights reserved.
-//
-
 import UIKit
+import CoreData
 
 class ViewController: UIViewController {
                             
@@ -15,6 +8,7 @@
     
     @IBAction func btnLoad(sender: UIButton) {
         var appDel:AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate
+        var context: NSManagedObjectContext = appDel.managedObjectContext
     }
     
     @IBAction func btnSave(sender: UIButton) {
Add reference to CoreData; Fetching the managed context object
