 import ActiveRecord
 
 class MasterViewController: UITableViewController, NSFetchedResultsControllerDelegate {
-
-    var managedObjectContext: NSManagedObjectContext? = nil
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
-        self.managedObjectContext = ActiveRecord.context()
-    }
 
     override func viewDidLoad() {
         super.viewDidLoad()

        
        // Edit the section name key path and cache name if appropriate.
        // nil for section name key path means "no sections".
        let aFetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.managedObjectContext!, sectionNameKeyPath: nil, cacheName: "Master")
        aFetchedResultsController.delegate = self
        _fetchedResultsController = aFetchedResultsController
        

        if _fetchedResultsController != nil {
            return _fetchedResultsController!
        }
            
        let moc = ActiveRecord.context()

        let fetchRequest = NSFetchRequest()
        // Edit the entity name as appropriate.
        let entity = NSEntityDescription.entityForName("Event", inManagedObjectContext: moc!)
        fetchRequest.entity = entity
        
        // Set the batch size to a suitable number.
