nsfetchedresultscontrolle

Creating table sections with NSFetchedResultsController

I'm using NSFetchedResultsController to drive the data for my UITableViewController. A simplified version of the managed object I am fetching looks like this (well for example): Person: -(BOOL)hasPet; -(BOOL)hasDog; Basically, I want my table to only show those Person objects who have a pet. So that's simple, I can use a predicate. No...

NSFetchedResultsControllerDelegate not firing

I can't figure out why, for the life of me, the NSFetchedResultsControllerDelegate methods are not firing when I add data to the underlying datastore. The data shows up immediately if I restart the iPhone application. I have subclassed UITableViewController and conform to NSFetchedResultsControllerDelegate: @interface ProjectListViewCo...

Is NSFetchedResultsControllerDelegate 'ChangeUpdate' behavior broken?

The docs for NSFetchedResultsControllerDelegate provide the following sample code - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { UITableView *t...

Not include temporary objects in fetch requests

Hi, I've got a fetched results controller handling a table view, and I'm having a problem that it is also showing new managed objects that have been created in the context but not saved to the store. I only want to list objects that have been saved. I have tried setting the setIncludesPendingChanges to NO in the fetch request but it's ...

iphone fetchRequest sub entities?

If i fetch data from "parent" and assign it to a fetchresultscontroller, i still have to call [parent.images allObjects] in my cellForRowAtIndexPath to get to the child data. Is this a normal thing to do or can i get the real data from child right in my fetchedresultscontroller? ...

How to observe managed object context

Hi, Whenever i make a change in the objects in the first tab of my application the updates are automatically upated in tab 2 becuase it uses a fetchedResultsController. Now i have a third tab that should also update itself, but how can i do that? I only have a nsmangedObjectContext in the third tab to get the appropriate data. How can ...

tableView and normal view (same data object)

Hi guys, I don't know how i can share the same data between two tab bar items. One tab uses nsfetchedresultscontroller and the other table is just a normal view that should use the same data as my fetchedresultscontroller. If i had two normals views, i would just make my object a singleton, and let the tableview and normal view use the...

NSFetchedResultsController Crash

Following steps result in a crash in NSFetchedResultsController. I try to add the first element to a NSFetchedResultsController backed TableView. I create a temporary MO object and display a Modal View pane to add new object. On the Add Sheet (a Modal View Controller), I press Cancel Button to discard the new element. In the CancelAct...

NSFetchedResultsController with search

What is the best practice to filter the NSFetchedResultsController data? do i need to re-initialize it every time the searchbar's text changes? I am using a UISearchDisplayControllers and i'm implementing: - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString; ...

UITableView insertRowsAtIndexPaths: is not updating the table when called from NSFetechedResultsController didChangeObject:

Good Morning, Im hoping someone can help me with an issue im having with updating a tableview via the insertRowsAtIndexPaths: method. I am calling a resource on the internet and creating entities based on the data i receive, for each entity I create and populate, I immediately save the entity to the managed object context. I can see e...

Illegal attempt to establish a relationship 'xyz' between objects in different contexts

I am using Apple's CoreDataBooks sample application as a basis for pulling data into a secondary managed object context in the background, and then merging that data into the primary managed object context. The data I am pulling in is a Book entity with a to-one relationship with an Owner entity (called "owner"). The Owner entity has a ...

How do you handle section inserts with an NSFetchedResultsController?

I've got an NSFetchedResultsController as my data source and and I implement NSFetchedResultsControllerDelegate in my custom UITableViewController. I'm using sectionNameKeyPath to break my result set into multiple sections. In one of my methods, I'm adding a couple of objects to the context, all of which are in a new section. At the m...

Core Data backed UITableView with indexing

I am trying to implement a Core Data backed UITableView that supports indexing (eg: the characters that appear down the side, and the section headers that go with them). I have no problems at all implementing this without Core Data using: - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; - (NSA...

Design pattern for Core Data iPhone App

Hi Im building an app that will use a Core Data model. I pretty new at Objective C and my usual design patterns does not really apply on Core Data and Objective C, at least I can't seem to find examples that confirms they will. I have been through the Apple Developer examples and different sources on the intertubes. It seems that to l...

Changing the Sorting in an NSFetchedResultsController on the fly

I'm trying to change the sorting in a NSFetchController on the fly, by some sort of segmented control. To either sort A->Z Z->A type thing. What do I have to do to do this? I'm following Jeff Lamarche's example here: Here Do I need to make a new NSFetchedResultsController and then set it, or do I just make a new NSFetchRequest and do ...

NSfetchedResultsControllerDelegate crashed tableview

Hello everyone, I'm using the NSFetchedResultsControllerDelegate to update my tableview. For example, //Now tableview doesn't have any record. 2009-11-15 12:25:48.328 XXX[36890:207] 0 //num sections before update //call tableview begin update 2009-11-15 12:25:54.277 XXX[36890:207] insert 0 //insert new section //begin to insert data ...

NSFetchedResultsController ERROR:

Afetr inserting a new record into my CoreData store using an NSFetchedResultsController, when I then try to display the data in a grouped UITableView the app crashes with the following error" NSFetchedResultsController ERROR: The fetched object at index 5 has an out of order section name 'Navigation. Objects must be sorted by section na...

Error when deleting from an NSFetchedResultsController controlled UITableView outside of the table view

I'm trying to remove an object managed by an NSFetchedResultsController in a UITableView - and I'm attempting to do so from a separate view via add/remove buttons. However, it seems as though controller and table are getting out of whack as I switch between views and I can't quit figure out why. Here is the error I am getting - unfortu...

How do you override sectionIndexTitlesForTableView using core data?

I'm would like to create a table that displays the date in full for the section headers, eg. @"EEEE dd MMMM yyyy". Then in the the fast user index on the righthand side use the @"MMM" value to provide quick access to a given month. I can get the index to work using the default value of first character from the core data. So the fetchedR...

The entity xxx is not key value coding-compliant for the key "(null)".

I am trying to write a simple table view editor for a Core Data entity. Unfortunately I'm running into problems. The error occurs when adding the very first entity to the table. The process for bringing up the modal dialog is as follows: NSManagedObjectContext *context = [fetchedResultsController managedObjectContext]; NSEntityDescript...