An instance of NSFetchedResultsController requires a non-nil fetchRequest and managedObjectContext?
===

I'm getting this error while trying to use Core Data:

> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An instance of NSFetchedResultsController requires a non-nil fetchRequest and managedObjectContext'

I traced the error back to this in my modal view controller which contains the Table View:

        - (void)setupFetchedResultsController
    {
        NSString *entityName = @"Location";
        NSLog(@"Setting up a Fetched Results Controller for the Entity named %@", entityName);
        
        NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:entityName];
        
    // ERROR OCCURS IN THE LINE BELOW vvv
        self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
                                                                            managedObjectContext:self.managedObjectContext
                                                                              sectionNameKeyPath:nil
                                                                                       cacheName:nil];
    
        [self performFetch];
    }

This is what I have in my AppDelegate:

        - (void)setupFetchedResultsController
    {
        NSString *entityName = @"Location"; 
        NSLog(@"Setting up a Fetched Results Controller for the Entity named %@", entityName);
        
        NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:entityName];
        
    
        
        self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
                                                                            managedObjectContext:self.managedObjectContext
                                                                              sectionNameKeyPath:nil
                                                                                       cacheName:nil];
        [self.fetchedResultsController performFetch:nil];
    }
 
I get no errors there, and here's more of the App Delegate:


    - (void)saveContext
    {
        NSError *error = nil;
        NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
        if (managedObjectContext != nil)
        {
            if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error])
            {
                // Using abort() right now just for development
                NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
                abort();
            } 
        }
    }
    
    #pragma mark - Core Data stack
    
    
    - (NSManagedObjectContext *)managedObjectContext
    {
        if (__managedObjectContext != nil)
        {
            return __managedObjectContext;
        }
        
        NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
        if (coordinator != nil)
        {
            __managedObjectContext = [[NSManagedObjectContext alloc] init];
            [__managedObjectContext setPersistentStoreCoordinator:coordinator];
        }
        return __managedObjectContext;
    }
    
    
    - (NSManagedObjectModel *)managedObjectModel
    {
        if (__managedObjectModel != nil)
        {
            return __managedObjectModel;
        }
        NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Model" withExtension:@"momd"];
        __managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
        return __managedObjectModel;
    }
    
    - (NSPersistentStoreCoordinator *)persistentStoreCoordinator
    {
        if (__persistentStoreCoordinator != nil)
        {
            return __persistentStoreCoordinator;
        }
        
        NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Forecaster.sqlite"];
        
        NSError *error = nil;
        __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
        
        
        NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
    							 [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
    							 [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
        if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])
        {
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            abort();
        }    
        
        return __persistentStoreCoordinator;
    }
    
    #pragma mark - Application's Documents directory
    
    
    - (NSURL *)applicationDocumentsDirectory
    {
        return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
    }

and in my Model.xcdatamodeid:

![Model][1]


  [1]: http://i.stack.imgur.com/RZBlG.png

Any help would be great! Thanks!