当我修改 fetchRequest 的谓词时,AQGridView 出现问题
我试图更改 NSFetchedResultsController 上的 fetchRequest 谓词,但是当我尝试从 aqgridview 重新加载数据时,没有显示任何单元格。
我的代码:
[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];
已解决:
好的,已解决。我必须更改 AQGridView.m 中的“setContentSize:(CGSize)newSize”方法:
From:
if (newSize.height < footerHeight + minimumHeight)
To:
if (newSize.height < minimumHeight)
由于minimumHeight已经包含footerHeight,之前,footerHeight被添加了两次。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了:回答问题。
I've solved: answer in the question.