nsfetchedresultscontroller

CoreData error driving me crazy… CoreData: Serious application error. An exception caught from delegate of NSFetchedResultsController

做~自己de王妃 提交于 2019-11-30 00:38:14
My application has two tab bars... Each takes the user to a tableviewcontroller that presents him with a list of items. The first view lets the user record entries in the database. The other tab/view reads from the database and presents those items to the user as well, however, no updates are made to the coreData/persistant store from this second view. When I add a new item via the first viewcontroller, it shows up perfectly in the view. However, as soon as I tap on the other tab bar to see the new item appear in that viewcontroller, I get the error listed below, and the newly added item does

Assertion failure when i use the Add Function

帅比萌擦擦* 提交于 2019-11-29 23:54:37
问题 In a table, I have 3 indexes which calls each a function. In each function, there is an add button that adds data into CoreData. First 2 works, but when i press the 3rd index and press Add , this error appears. 2011-07-19 16:57:11.079 CoreDataMelaka[2704:207] * **Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1447.6.4/UITableView.m:976** 2011-07-19 16:57:11.080 CoreDataMelaka[2704:207] **Serious application error. Exception was caught during

NSFetchedResultsController crashing on performFetch: when using a cache

天大地大妈咪最大 提交于 2019-11-29 20:35:12
I make use of NSFetchedResultsController to display a bunch of objects, which are sectioned using dates. On a fresh install, it all works perfectly and the objects are displayed in the table view. However, it seems that when the app is relaunched I get a crash. I specify a cache when initialising the NSFetchedResultsController, and when I don't it works perfectly. Here is how I create my NSFetchedResultsController: - (NSFetchedResultsController *)results { // If we are not nil, stop here if (results != nil) return results; // Create the fetch request, entity and sort descriptors NSFetchRequest

NSFetchedResultsController prepend a row or section

烈酒焚心 提交于 2019-11-29 20:01:41
I have a UITableView populated with a standard NSFetchedResultsController. However I'd like to prepend a row or a section (row preferably but either would works fine really.) The only way I can possibly see doing this right now is to rewrite all the NSIndexPath's manually when dealing with the section/rows dealing with the data from NSFetchedResultsController to trick it into seeing section at index 0 and starting with row at index 0. This however seems like a really bad idea that would quickly get confusing so I'd like to preferable avoid that. A good example of this would be in the official

UITableView with NSFetchedResultsController Does Not Load the Second Time

情到浓时终转凉″ 提交于 2019-11-29 19:20:07
问题 Update 3 These are the logs after the first run with an empty data store. 2013-02-07 20:57:06.708 Five Hundred Things[14763:c07] mainMOC = <NSManagedObjectContext: 0x7475a90> 2013-02-07 20:57:06.711 Five Hundred Things[14763:1303] Import started 2013-02-07 20:57:06.712 Five Hundred Things[14763:1303] backgroundMOC = <NSManagedObjectContext: 0x8570070> 2013-02-07 20:57:06.717 Five Hundred Things[14763:c07] FRC fetch performed 2013-02-07 20:57:06.718 Five Hundred Things[14763:c07]

How to refresh a UITableViewController or NSFetchedResultsController?

拟墨画扇 提交于 2019-11-29 18:41:50
问题 I have a little problem with my UITableViewController or NSFetchedResultsController. I am not sure which is the problem soure but I guess its the UITableViewController. As I said I use a NSFetchedResultsController to fill my data into a UITableViewController. The data is sorted by date and is also displayed in sections by date-year, e.g. May 2010/June 2010/ and so on. This is displayed as the section header. Now when I add new data, it automatically uses the current date as default, but if I

Core Data Reset [duplicate]

天涯浪子 提交于 2019-11-29 18:26:51
This question already has an answer here: Reset a CoreData persistent store 7 answers I am working with resetting my data in coreData, below is my code to reset my data in CoreData - (void) resetApplicationModel { __managedObjectContext = nil; __managedObjectModel = nil; __persistentStoreCoordinator = nil; _allPageViewController.controller = nil; NSError *error; NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"abc.sqlite"]; if ([[self.managedObjectContext persistentStoreCoordinator] removePersistentStore:[[[self.managedObjectContext

UISearchDisplayController animate reloadData

走远了吗. 提交于 2019-11-29 16:11:25
I've been reading all the documentation about UISearchDisplayController and its delegate but I can't find any way to animate the table view when the search criteria change. I'm using these two methods : They both return YES but still can't find any way to do something similar to : I don't know if it's important but I'm using an NSfetchedResultsController to populate the UITableView in the UISearchDisplayController That's it thanks ! When the search string or scope has changed, you assign a new fetch request for the fetched results controller and therefore have to call performFetch to get a new

How to unit-test NSFetchedResultsController in Swift

戏子无情 提交于 2019-11-29 14:15:16
问题 I have a Swift app that uses NSFetchedResultsController to fetch List objects from persistent store: let fetchedResultsController: NSFetchedResultsController = ... var error : NSError? fetchedResultsController.performFetch(&error) if let error = error { NSLog("Error: \(error)") } let lists: [List] = fetchedResultsController.fetchedObjects! as [List] NSLog("lists count = \(lists.count)") for list: List in lists { NSLog("List: \(list.description)") } and it works like expected, I am getting

Add extra row to a UITableView managed by NSFetchedResultsController

。_饼干妹妹 提交于 2019-11-29 13:22:12
I'm using a UITableViewController for a table in my app, and I've added an NSFetchedResultsController to provide the data to show in the table (setting self as it's delegate). However I would like to add a unique cell as the last cell of the table, unrelated to the items produced by the NSFetchedResultsController 's predicate, I want this cell to always be at the bottom of the table. I've tried simply added 1 to these methods in the table view data source: - (NSUInteger)numberOfSectionsInTableView:(UITableView *)sender { return [[self.fetchedResultsController sections] count] + 1; } -