如何重新加载 NSFetchedResultsController?
我有一个应用程序,可以预加载一个月的数据,并且每天发布一次。
NSDate *now = [NSDate date];
// Create predicate
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(location.name == %@) AND (date < %@)",longLocation,now];
在多任务处理之前,一切都运行良好,但现在它不再从零开始,我无法让它识别新日期并根据该新日期重新加载数据。
我已将视图加载到 TabBarController 中。它似乎想永远保留该视图,而我似乎无法让 viewWillAppear 执行任何操作。
任何帮助将不胜感激。 谢谢
I have an app that preloads a months worth of data and it gets released a day at a time.
NSDate *now = [NSDate date];
// Create predicate
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(location.name == %@) AND (date < %@)",longLocation,now];
Everything worked great before multi-tasking, but now that it no longer starts from nil I cannot get it to recognize the new date and reload the data based on that new date.
I have the view loaded into a TabBarController. It seems to want to hang onto that view forever and I can't seem to get viewWillAppear to do anything.
Any help would be greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的 fetchRequestController 使用缓存,并且您想修改 fetchRequest(例如更改谓词),则必须在再次使用 PerformFetch 之前删除缓存
If your fetchRequestController uses a cache and if you want to modify the fetchRequest (for example changing a predicate) you have delete the cache before using performFetch again