nsfetchedresultscontrolle

NSSortDescriptor for NSFetchRequestController causes crash when value of sorted attribute is changed

I have an Core Data Entity with a number of attributes, which include amount(float), categoryTotal(float) and category(string) The initial ViewController uses a FethchedResultsController to retrieve the entities, and sorts them based on the category and then the categoryTotal. No problems so far. NSManagedObjectContext *moc = [self ma...

NSFetchedResultsController based Table View always fails on SECOND insert of entity

I am using an NSFetchedResultsController to manage displaying fetched managed objects in a table view that has one section. The table starts out empty and the user can add new entities to it using the UI. As it stands, the program always works when adding the first entity, and always crashes when adding a second. There is sometimes no...

Multiple NSFetchedResultControllers for different entities?

I'm checking out the default Xcode template for an iPhone Core Data project. In the method that returns the fetched result controller I see this: - (NSFetchedResultsController *)fetchedResultsController { ... NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForN...

Core Data: UITableView with multiple NSFetchedResultControllers

What I want to do is pretty simple. In my UITableViewController, I want to load data from multiple NSFetchedResultControllers (I have multiple entities in my data model) and put data from each one into a different section in the table view. So for example, all the fetched items from the first NSFetchedResultController would go in section...

Core Data Fetched Results Controller and Custom Section Header

I am familiar with the common and basic use of a NSFetchedResultsController managing the rows of a table, but I have an interesting problem. My data is organized as such: Schedule <--->> Day <--->> Route. I currently have a table view that has Schedules with a fetch controller managing the creation and deletion of Schedules. I now wan...

NSFetchedResultsController Crashes When Navigating from One UITableViewController to Another

In my core data model I have a Person entity that has a "to many" relationship a Course entity (I also have an inverse "to one" relationship from Course to Person). Now I have a subclassed UITableViewController that uses a NSFetchedResultsController to display Person objects which works fine. I have this set up so that when you click o...

Performing multiple fetches in Core Data within the same view

I have my CD store setup and everything is working. Once my initial fetch is performed, I need to perform several fetches based on calculations using the data from my first fetch. The examples provided from Apple are great, and helped me get everything going but I'm struggling with executing successive fetches. Any suggestions, or tutori...

How can I sort by a transformable attribute in an NSFetchedResultsController?

I'm using NSValueTransformers to encrypt attributes (strings, dates, etc.) in my Core Data model, but I'm pretty sure it's interfering with the sorting in my NSFetchedResultsController. Does anyone know if there's a way to get around this? I suppose it depends on how the sort is performed; if it's always only performed directly on the d...

NSFetchedResultsController is driving me crazy

Hi everyone. i've been building an app since 1 month using NSFetchedResultsController and i was testing the app on the 3.1.2 SDK. The poblem is that i've been using NSFetchedResultsController everywhere in my app and was working on the 3.1.2 version of the SDK, now my client say that i should make it compatible with the 3.0 version and ...

Custom Section Name Crashing NSFetchedResultsController

I have a managed object with a dueDate attribute. Instead of displaying using some ugly date string as the section headers of my UITableView I created a transient attribute called "category" and defined it like so: - (NSString*)category { [self willAccessValueForKey:@"category"]; NSString* categoryName; if ([self isOverdue]...

NSFetchedResultsController: changing predicate not working?

Hi, I'm writing an app with two tables on one screen. The left table is a list of folders and the right table shows a list of files. When tapped on a row on the left, the right table will display the files belonging to that folder. I'm using Core Data for storage. When the selection of folder changes, the fetch predicate of the right ta...

Core Data: Keypath "objectID" not found in entity

I'm using NSFetchedResultsController with a predicate to load a list of Documents in my application. I want to load all the Documents except the currently active one. I am using Rentzsch's MOGenerator to create a _Document class and then I put all my custom code in the Document subclass. _Document generates an objectID property with typ...

Serious Application Error

I have a TableView controller class that uses a fetched results controller to display a list of 'patient' entities taken from a Core Data model. The sections of this table are taken from a patient attribute called 'location'. Here is the sort descriptor for the fetch request: NSSortDescriptor *locationDescriptor = [[NSSortDescriptor all...

Sorting by dates (including nil) with NSFetchedResultsController

In my NSFetchedResultsController, I set a sortDescriptor that sorts based on the date property of my managed objects. The problem that I have encountered (along with several others according to Google) is that nil values are sorted at the earliest end rather than the latest end of the date spectrum. I want my list to be sorted earliest...

NSFetchedResultsController fetch request - updating predicate and UITableView

In my iPhone Core Data app I have it configured in a master-detail view setup. The master view is a UITableView that lists objects of the List entity. The List entity has a to-many relationship with the Task entity (called "tasks"), and the Task entity has an inverse to-one relationship with List called "list". When a List object is se...

Diference between get Object using FetchResultController and ManagedObjectContext

What's the difference between get elements from Core Data with FetchResultController or ManagedObjectContext?? 1) FetchResultController NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:[NSEntityDescription entityForName:@"Item" inManagedObjectContext: managedObjectContext]]; NSSortDescriptor *sor...

NSFetchRequest / Predicate Question

I have two entities: Patient and Job. Patient has a to-many relationship to Job called 'jobs' and Job has a to-one relationship to Patient called 'patient'. Job has attributes called 'dueDate' (Date) and 'completed' (BOOL) and Patient has attributes 'firstName' and 'lastName' (both Strings). I am trying to create a fetch request / predi...

NSFetchedResultsController - Delegate methods crashing under iPhone OS 3.0, but NOT UNDER 3.1

Hey guys, so I've got my NSFetchedResultsController working fine under the 3.1 SDK, however I start getting some weird errors, specifically in the delegate methods when I try it under 3.0. I've determined that this is related to the NSFetchedResultsControllerDelegate methods. This is what I have set up. The inEditingMode stuff has to do...

NSFetchedResultsController secondary sorting not working?

Hello, I'm using NSFetchedResultsController to fetch Message entities with Core Data. I want my tableview to group the messages by an attribute called ownerName. This works fine in the sense that I get a proper UI dispalying appropriately named sections. I can achieve this with the code below: NSSortDescriptor *sortDescriptor = [[NS...

NSPredicate acting strange in NSFetchedResultsController

I feel as if this should be very simple, but it's behaving strangely. I have 3 entities, with a relationship as such Entity A <-->> Entity B <<--> Entity C I have an NSFetchedResults controller and I'm trying to filter the results of Entity A using the following predicate. [NSPredicate predicateWithFormat:@"NONE entityB.entityC == %@...