Do I need a second NSFetchedResultsController
===

A function of my app uses core data to store expenses of user as an attribute. I'm trying to display the sum of all these expenses on the first section of my table view controller.

I've got it working perfectly when the sum is displayed at the section 1 of my table. However when I use the section 0 it just breaks. I've debugged the app to find out where and why it breaks. I figured out that the problem comes up when calling fetchedResultsController twice. 

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
        {
            // Return the number of rows in the section.
            if (section == 1) {
                return 1;       
            }
            if (section == 0){
                return [self.fetchedResultsController.fetchedObjects count]; 
            }
            else return 0;
        }

    - (NSFetchedResultsController *)fetchedResultsController
    {
        if (_fetchedResultsController != nil) {
    
            return _fetchedResultsController;
        }
        
        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        NSEntityDescription *entity = [NSEntityDescription entityForName:@"Gastos" inManagedObjectContext:self.managedObjectContext];
        
        [fetchRequest setEntity:entity];
        [fetchRequest setFetchBatchSize:20];
        
        NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"nombre" ascending:NO];
        NSArray *sortDescriptors = [NSArray arrayWithObjects:sortDescriptor, nil];
        
        [fetchRequest setSortDescriptors:sortDescriptors];
        
        NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:@"Master"];
        aFetchedResultsController.delegate = self;
        _fetchedResultsController = aFetchedResultsController;
        
    	NSError *error = nil;
    	if (![_fetchedResultsController performFetch:&error]) {
    	    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    	    abort();
    	}
        
        return _fetchedResultsController;
    }

This won't work because _fetchedResultsController has been created for the sum. Do I need to use another NSFetchedResultsController just for the sum? Whether it's the case, how would you do it? Thanks 

       - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
            {
                // Return the number of rows in the section.
                if (section == 0) {
                    return 1;       
                }
                if (section == 1){
                    return [self.fetchedResultsController.fetchedObjects count]; 
                }
                else return 0;
            }


  