         }
     }()
 
-    lazy var currentClasses: [Class] = {
-//        do {
-//            return try self.context.objects("Class") as? [Class]
-//        } catch {
-//            return []
-//        }
-    }()
-
     // MARK: ViewController
 
     override func viewDidLoad() {


    @IBOutlet weak var tableView: UITableView!

    var selectedClass: Class?

    lazy var context: NSManagedObjectContext = {
        let delegate: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate

        NSOperationQueue.mainQueue().addOperationWithBlock { () -> Void in
                self.performSegueWithIdentifier("LoginSegue", sender: self)
            }
        }
    }

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        self.networkHandler.myClass(0, context: context, success: { (result: [AnyObject]!) -> Void in
            self.currentClasses = result as? [Class]
            }, failure: { (error: NSError!) -> Void in
                print(error)
            }) { () -> Void in
                self.tableView.reloadData()
        }
    }

