nsfetchedresultscontroller

iPhone Development - CoreData runtime error

て烟熏妆下的殇ゞ 提交于 2019-12-24 11:37:09
问题 I'm facing a strange CoreData issue. Here's the log: 2010-04-07 15:59:36.913 MyProject[263:207] <MyEntity: 0x180370> (entity: MyEntity; id: 0x17e890 <x-coredata://0F55C533-41BD-4F09-9CCA-0CB304CAB065/MyEntity/p380> ; data: <fault>) 2010-04-07 15:59:36.918 MyProject[263:207] *** Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'The NSManagedObject with ID:0x17e890 <x-coredata://0F55C533-41BD-4F09-9CCA-0CB304CAB065/MyEntity/p380> has been invalidated.' I have a

Core Data Serious Application Error at controllerDidChangeContent

[亡魂溺海] 提交于 2019-12-24 11:34:45
问题 Hello I am stacked now with the error below. CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Invalid update: invalid number of sections. The number of sections contained in the table view after the update (7) must be equal to the number of sections contained in the table view before the update (6), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).

NSFetchedResultsController with section names

久未见 提交于 2019-12-24 11:12:33
问题 Scenario: I have an expense tracking iOS Application and I am storing expenses from a expense detail view controller into a table view (with fetched results controller) that shows the list of expenses along with the category and amount and date. I do have a date attribute in my entity "Money" which is a parent entity for either an expense or an income. My Question: What I want is to basically categorize my expenses/incomes for a given week, a month, or year and display it as the section

The performance of NSSortDescriptor?

坚强是说给别人听的谎言 提交于 2019-12-24 09:59:38
问题 I have a SQLite backed database of roughly 4000 rows, connected to Core Data. The model is a simple overview -> detail model. Each overview (with title and subtitle) has a relationship to a detail, which contains detailed information. To view this data I have implemented a UITableView with a NSFetchedRequestController. NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"registered_name" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObject:sort]; NSPredicate

ios 10 NSfetchedResultController does not animate when deleting multiple rows

给你一囗甜甜゛ 提交于 2019-12-24 09:39:32
问题 Hi I'm working with an app with CoreData and NSfetchedResultController. I'm running into a strange issue when deleting multiple rows. The deletion animation work fine with IOS 9 but when come to IOS 10. There is now animation (cell only disappear no mater what animation is choosen). Here my fetchedResultController (from Master-detail template) // MARK: - Fetched results controller var fetchedResultsController: NSFetchedResultsController<Event> { if _fetchedResultsController != nil { return

Sort/Filter NSFetchRequest how to write sort descriptor taht will use current date?

☆樱花仙子☆ 提交于 2019-12-24 07:37:27
问题 I'm storing in Core Data 2 date properties, one is expire date and second is "amber" date (the date that is X weeks before expire date). I want to sort results in following way: items before the amber date - (green) now < amber items after amber date but before expire date - (amber) amber <= now < expire items on or after expire date - (red) expire <= now Can you help me with that? UPDATE After more research I've found that I could fetch results unsorted, put it in the array and sort the

How to know which property is changed for NSFetchedResultsChangeUpdate?

谁说胖子不能爱 提交于 2019-12-24 04:41:21
问题 I thinks there is a problem of controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: , specifically for NSFetchedResultsChangeUpdate : It does not tell you what change causes this NSFetchedResultsChangeUpdate . I have a very complex entity. Only a part of its data is are used to populate my table view cells. I don't want to update my cells for any irrelevant property changes — it is a waste of resources. So how can I know which property change causes this

How to know which property is changed for NSFetchedResultsChangeUpdate?

淺唱寂寞╮ 提交于 2019-12-24 04:41:15
问题 I thinks there is a problem of controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: , specifically for NSFetchedResultsChangeUpdate : It does not tell you what change causes this NSFetchedResultsChangeUpdate . I have a very complex entity. Only a part of its data is are used to populate my table view cells. I don't want to update my cells for any irrelevant property changes — it is a waste of resources. So how can I know which property change causes this

How to change managed object class name before fetching

依然范特西╮ 提交于 2019-12-24 04:32:12
问题 I have a Swift app that uses CoreData. I created List entity with class MyAppTarget.List . Everything is configured properly in .xcdatamodeld file. In order to fetch my entities from persistent store, I am using NSFetchedResultsController : let fetchRequest = NSFetchRequest() fetchRequest.entity = NSEntityDescription.entityForName("List", inManagedObjectContext: managedObjectContext) fetchRequest.sortDescriptors = [ NSSortDescriptor(key: "name", ascending: true) ] let fetchedResultsController

How to change managed object class name before fetching

我是研究僧i 提交于 2019-12-24 04:32:02
问题 I have a Swift app that uses CoreData. I created List entity with class MyAppTarget.List . Everything is configured properly in .xcdatamodeld file. In order to fetch my entities from persistent store, I am using NSFetchedResultsController : let fetchRequest = NSFetchRequest() fetchRequest.entity = NSEntityDescription.entityForName("List", inManagedObjectContext: managedObjectContext) fetchRequest.sortDescriptors = [ NSSortDescriptor(key: "name", ascending: true) ] let fetchedResultsController