nsfetchedresultscontroller

Crash when Fetched Results Controller updates table after saving a background MOC

喜夏-厌秋 提交于 2019-12-11 19:32:37
问题 I have a tableView hooked up to a FRC (Fetched Results Controller) , I also have two contexts , namely backgroundContext initialised in a private queue and a mainContext initialised on the main queue. I also have setup the didSaveNotification to pass the objects from one context to another. When ever i save some data in the backgroundContext it saves successfully and FRC updates ,but if i repeat the process again the app crashes with an error 'The left hand side for an ALL or ANY operator

CoreDataTableView Not Updating When Saving From Child ManagedObjectContext and Parent ManagedObjectContext

孤者浪人 提交于 2019-12-11 19:22:07
问题 I'm trying to populate CoreData from a JSON file with thousands of entries. What I'm trying to do is create a new NSManagedObjectContext with the parent property set to my main NSManagedObjectContext. Every so often I save on my child context and if successful then save on my main context. If that's also successful I try to reload my tableview. My CoreDataTableView is setup with an NSFetchedResultController and taken directly from Apple's documentation. However, the table view isn't refreshed

RESTKIT + COREDATA = FetchResultsController issue

独自空忆成欢 提交于 2019-12-11 19:07:13
问题 Hi I have a problem with NSFetchedResultsController which is populated by data from the web application. To map tables from the server side I'm using RestKit framework . When I'm changing the current user the data inside my UITableViewController still present cells from the previous user but without information received from the server - just default label text values. However the number of cells is the same as the previous user. It happens to me only in one UITableViewController in others

Using an NSMutableArray instead of an NSFetchedResultsController

人盡茶涼 提交于 2019-12-11 16:08:48
问题 I've recently come to learn that NSFetchedResultsController is an extremely buggy class and its been causing me headaches for a while now with my rather large Core Data app. Would it be appropriate to use an NSMutableArray to feed the table view instead of an NSFetchedResultsController ? What I'm talking about is, temporarily creating a fetched results controller to grab the objects from my managed object context, creating a new NSMutableArray with the fetchedObjects from the fetched results

Section update event not being called from related entity in swift

混江龙づ霸主 提交于 2019-12-11 13:32:46
问题 Below is a link to download a simplified version of my app that has the exact same problem. The plus "Add" button at the top adds a new record that is set at name = 1, qty = 1, and section = 1. Selecting a Cell increments them all to the next number. You can see that both the name and qty update, but the section never updates until you quit the app and start it again. DropBox Download Link I have the following relationship setup in CoreData: In in my TableViewController, I am creating my

How to update table view cell?

ぃ、小莉子 提交于 2019-12-11 12:44:54
问题 I have a UITableView with one big cell and many small cells. When I receive content from server I update my UITableView with function - (BOOL)performFetch:(NSError **)error ( NSFetchedResultsController ). I noticed that my big cell has dublicate after update and the second cell doesn't reload. When I scroll down and scroll to top table looks good. How can I solve my problem? 回答1: "performFetch" updates the datasource but the tableview itself is not updated. For updating the tableview use

Displaying multiple NSFetchedResultsControllers in different sections of same UITableView

倖福魔咒の 提交于 2019-12-11 12:29:05
问题 good morning. In my App, I have different Entities and I want to show it in the same TableView. I know that to do it, I need different NSFetchedResultsController. When I add an object do the first section, no problem appears, but when I add an object to the second, the problem appears. Here is the code the I'm using import UIKit import CoreData class MainMenu: UITableViewController, NSFetchedResultsControllerDelegate { /**********/ /** Vars **/ /**********/ lazy var frcAccount:

UILabel in custom UITableView cell not updating with Core Data change

为君一笑 提交于 2019-12-11 10:37:45
问题 I'm attempting to build a game scoring app that utilizes a custom table cell with player photos, names, buttons etc... There are add/subtract buttons directly in the custom cell of the tableview that are hitting my save method, and it's storing it back in Core Data for that specific user. The problem is with the on-screen score not updating and reflecting the change. After the save action to Core Data is complete, I'm calling the [self.tableView reloadData]; ... nothing. However, if I restart

`NSFetchedResultsController` not refreshing when updating relationship from child context

陌路散爱 提交于 2019-12-11 10:27:33
问题 If I make changes to a managed object on a child context and then save that context, if the changes are only to the relationships of that object, it does not refresh. Is there a solution to this besides also updating a property of said object? 回答1: Have you tried calling -processPendingChanges on the context after you have merged the changes? Apple's documentation states Changes are not reflected until after the controller’s managed object context has received a processPendingChanges message.

NSFetchedResultsControllerDelegate animating deletion on wrong indexPath

China☆狼群 提交于 2019-12-11 10:17:49
问题 The premise: I have a UITableViewController that conforms to NSFetchedResultsControllerDelegate . I also have a fetched results controller and managed object context as variables in the controller. My tableView displays a table with one section of core data objects from the fetched results controller. What I'm trying to implement is swipe to delete. The object selected for deletion is actually deleted, however the wrong indexPath is being animated to delete and I don't know why. I currently