nsfetchedresultscontrolle

Appending data to NSFetchedResultsController during find or create loop

I have a table view that is managed by an NSFetchedResultsController. I am having an issue with a find-or-create operation, however. When the user hits the bottom of my table view, I am querying my server for another batch of content. If it doesn't exist in the local cache, we create it and store it. If it does exist, however, I want...

iPhone Development - CoreData runtime error

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 'NSObjectInaccess...

Core Data (NSFetchedResultsController) displaying one row per section

I have a CoreData application which uses NSFetchedResultsController. NSFetchedResultsController is useful in that it allows me to access the fetched objects more easily etc. but I find that I have problems with the following: I get a crash when I display a single row for each section (irrespective of the number of actual rows present) a...

In short, how is NSFetchedResultsController used?

I'm reading now since one hour through the documentation and still don't get the point of NSFetchedResultsController. Is it a replacement for UITableViewController? Or is the UITableViewController using the NSFetchedResultsController? Is the NSFetchedResultsController the data source? What is it? ...

NSFetchedResultsController titleForHeaderInSection with formatted NSDate

In my Core Data app I am using a FetchedResultsController. Usually to set titles for headers in a UITableView you would implement the following method like so: - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { id <NSFetchedResultsSectionInfo> sectionInfo = [[<#Fetched results controller#>...

Sort NSFetchedResultsController results by user location

I have an application that contains some Locations in Core Data, and I want to show them to the user in order of proximity to the user's location. I am using an NSFetchedResultsController to serve the locations to the Table View. I thought about creating a virtual accessor method that returns the location's distance from the user, that w...

How to deal with many to many relationships with NSFetchedResultsController?

OK so I have two entities in my data model (let's say entityA and entityB), both of these entities have a to-many relationship to each other. I have setup a NSFetchedResultsController to fetch a bunch of entityA. Now I'm trying to have the section names for the tableview be the title of entityB. sectionNameKeyPath:@"entityB.title" N...

NSFetchedResultsController crashing on performFetch: when using a cache

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 ...

NSFetchedResultsController didn't return data

Hello! I get stuck in some problem and after 2 days of seeking I've found solution but didn't get idea why does it work. First, I'm initialized NSFetchedResultsController using following code (it look like a lot of automatically generated): - (NSFetchedResultsController *)fetchedResultsController { if (fetchedResultsController != nil...

Passing data between ViewControllers versus doing local Fetch in each VC

Hi All, I'm developing an iPhone app using Core Data and I'm looking for some general advice and recommendations on whether its acceptable to pass data between ViewControllers versus doing a local fetch in each ViewController as you navigate to it. Ordinarily I would say it all depends on various factors (e.g. performance etc) but the pa...

NSFetchedResultsController sections localized sorted

How could I use the NSFetchedResultsController with translated sort key and sectionKeyPath? Problem: I have ID in the property "type" in the database like typeA, typeB, typeC,... and not the value directly because it should be localized. In English typeA=Bird, typeB=Cat, typeC=Dog in German it would be Vogel, Katze, Hund. With a NSFetc...

setIncludesSubentities: in an NSFetchRequest is broken for entities across multiple persistent stores

Prior art which doesn't quite address this: http://stackoverflow.com/questions/1774359/core-data-migration-error-message-model-does-not-contain-configuration-xyz I have narrowed this down to a specific issue. It takes a minute to set up, though; please bear with me. The gist of the issue is that a persistentStoreCoordinator (apparentl...

Core Data NSFetchedResultsController sorting in certain sequence

I'm writing iphone app that has UITableView and uses Core Data. Data in UITableView is shown using NSFetchedResultsController. I use NSPredicate operator "IN" to fetch only needed entries. NSArray *filterArray = [NSArray arrayWithObjects:@"789", @"963", @"445", @"198", nil]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"i...

uisearchbar + uitableview + nsfetchedresultscontroller

Hi all, I have a view controller that has a UITableView which is populated by a NSFetchedResultsController. I'd like to add a UISearchBar to be able to filter the records from Core Data that are displayed in the UITableView via the NSFetchedResultsController. I'd like to know what the "cleanest" way to do this is, and if there is a cl...

NSFetchedResultsController: using of NSManagedObjectContext during update brings to crash

Here is the interface of my controller class: @interface ProjectListViewController : UITableViewController <NSFetchedResultsControllerDelegate> { NSFetchedResultsController *fetchedResultsController; NSManagedObjectContext *managedObjectContext; } @end I use following code to init fetchedResultsController: if (fetchedResults...

iPhone contacts app styled indexed table view implementation

My Requirement: I have this straight forward requirement of listing names of people in alphabetical order in a Indexed table view with index titles being the starting letter of alphabets (additionally a search icon at the top and # to display misc values which start with a number and other special characters). What I have done so far: 1...

iPhone: Fetched Results Controller, don't use sections in UITableView

I am using a fetched results controller, which, it seems wants to set up using sections in my UITableView. Well, in this case, I don't want to use sections. Which, is easy enough to set the value for numberOfSectionsInTableView: to 1. But, now I am not sure how to get the numberOfRowsInSection: to return all of the cells into one sect...

Calling NSFetchedResultsController & CoreData experts

I am having a few nagging issues with NSFetchedResultsController and CoreData, any of which I would be very grateful to get help on. Issue 1 - Updates: I update my store on a background thread which results in certain rows being delete, inserted or updated. The changes are merged into the context on the main thread using the "mergeChan...

NSFetchedResultsController not processing certain section driven moves

I utilize a NSFetchedResultsController (frc) with a Core Data store. I implement all the frc delegate methods. The table is sporadically updated by background threads. All the inserts, deletes and updates work fine, with the exception that updates to the frc's index key for rows toward to the bottom of the table (50 rows), do not result ...

Display shift when adding rows to UITableView

Hello, I have a UITableView displaying an underlying NSFetchedResultsController. When the fetchedResultsController is updated, - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newInde...