Search code examples
core-datansfetchedresultscontrollernspredicateaqgridview

AQGridView problem when i modify the fetchRequest's predicate


I'm trying to change the fetchRequest's predicate on my NSFetchedResultsController, but when i try to reload the data from the aqgridview, none cell is displayed.

My code:

[NSFetchedResultsController deleteCacheWithName: nil];  

NSPredicate *predicate = [NSPredicate predicateWithFormat: @"colection = %@", newcolection ];
[fetchedResultsController.fetchRequest setPredicate:predicate];

NSError *error = nil;
if (![[self fetchedResultsController] performFetch:&error]) {
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    abort();
}

[comicGridView reloadData];

SOLVED:

OK, solved. I had to change the "setContentSize: (CGSize) newSize" method in AQGridView.m:

From:

if (newSize.height < footerHeight + minimumHeight)

To:

if (newSize.height < minimumHeight)

As minimumHeight already contains footerHeight, before, footerHeight is added in twice.


Solution

  • I've solved: answer in the question.