Questions tagged [nsfetchedresultscontroller]

An Apple fetched results controller is used to efficiently manage the results returned from a Core Data fetch request to provide data usually for a UITableView or UICollectionView object. It is available in iOS 3.0 and later.

An Apple controller used to efficiently manage the results returned from a Core Data () fetch request to provide data for a UITableView or UICollectionView object.

From Apple Official NSFetchedResultsController Document, fetched results controllers provide the following features:

  • Optionally monitor changes to objects in the associated managed object context, and report changes in the results set to its delegate (see: The Controller’s Delegate).

  • Optionally cache the results of its computation so that if the same data is subsequently re-displayed, the work does not have to be repeated (see: The Cache).

Example:

NSFetchedResultsController *controller = [[NSFetchedResultsController alloc]
    initWithFetchRequest:fetchRequest
    managedObjectContext:context
    sectionNameKeyPath:nil
    cacheName:@"<#Cache name#>"];

[fetchRequest release];

Questions in Stack overflow related coredata

  1. Good tutorials or good for using Core.Data in IOS 7

  2. JSON and Core Data on the iPhone

  3. Why use NSFetchedResultsController?

2287 questions
0
votes
1 answer

CoreData sort by upcoming birthdays

I'm building my first app in xcode and trying to fetch a list of people ordered by upcoming birthdays using coreData and NSFetchedResultController. My entity is setup as follows uBirthdays -------------- NSString uName NSDate uBday Here is my…
0
votes
1 answer

My app crashes when i add core data to a table view

I have two table views in one view controller that both hold separate types of data not related to each other. for some reason whenever I add new data to either project the app crashes because it adds the new data to both table views instead of only…
0
votes
0 answers

NSFetchedResultsController sectionIndexTitles property

I've implemented an NSFetchedResultsController correctly so that it splits up my fetched data by sections. When I try print out its property sectionIndexTitles I just get "0", but if I iterate over its sections and print out the section names it…
MarksCode
  • 8,074
  • 15
  • 64
  • 133
0
votes
1 answer

Searching with NSFetchResult Controller

I've been looking on how to search using a NSFetchResultController but most post I came across are from 2 years ago. Okay I'm trying to filter the objects, which in my case are Pokemon. Here is my function I'm using. func…
Luis Ramirez
  • 966
  • 1
  • 8
  • 25
0
votes
1 answer

iphone SDK: Core Data, how to sort sections in an NSFetchedResultsController?

I have a core data app that is using the sectionNameKeyPath "group.name" with the fetchRequest in order to group the results by the group entity's name attribute. I'm grouping by group.name but I'd like to sort the sections by something other than…
memmons
  • 40,222
  • 21
  • 149
  • 183
0
votes
1 answer

Grouping messages similar to iPhone Message app

In our iOS application, we are using core data and tied it with a table view using NSFetchedResultsController. The app is about "Chat" feature. UI is same as that of iPhone "Messages" app. When we tap on a message, it displays the history and all…
Satyam
  • 15,493
  • 31
  • 131
  • 244
0
votes
0 answers

Can a fetch request template not be used with NSFetchedResultController?

This code is in my Entity+CoreDataProperties.swift file: @nonobjc public class func mFetchRequest() -> NSFetchRequest { return (getContext().persistentStoreCoordinator?.managedObjectModel.fetchRequestTemplate(forName: "MEntityRequest"))!…
daredevil1234
  • 1,303
  • 1
  • 10
  • 34
0
votes
1 answer

TableView sections with NSManaged Object Context Throws Exception

I recently migrated a project from a self-managed object using a config singleton to use the NSManaged Object Context with NSFetchedResultController. What I'm trying to do is fill a TableView with sections that are based on month however the user…
0
votes
1 answer

How to filter data using coreData

I want to know how to filter data while using a searchBar. Lets say I have 300 friend objects and I want to find a specific friend named "Rick" in my tableView. While searching, I would like to filter my friends every time a character is enter. So…
Luis Ramirez
  • 966
  • 1
  • 8
  • 25
0
votes
1 answer

FetchedResultsController sectionKeyPath on different entity

Is it possible to define a sectionKeyPath that is on a different entity? I have a set of users which are the entities the fetchedResultsController is displaying. I would like to sort them into 2 sections, based on whether they have unread messages…
some_id
  • 29,466
  • 62
  • 182
  • 304
0
votes
0 answers

iOS NSFetchedResultsController with UITableView Sections

I am wondering how to solve my problem. I have: Entity A: Advertisers Entity B: Offers I have some Advertisers with many offers (1:n relation) and Advertisers without offers. Finally, each offer has a price. I have a UITableView with two…
0
votes
0 answers

Sort items inside sections with NSFetchedResultsController and SortDescriptors

I am facing a problem with my custom UITableView when sorting rows. Let me explain in to you. I have an UITableView with sections that use the NSFetchedResultsController to make a request and grab my objects from my database and separate them into…
0
votes
1 answer

TableViewController not refreshing after FRC is updated

On selecting a row in an NSFetchedResultsController (FRC), my app allows the details to be changed by segueing to a detail view controller. After saving changes, the edited row is returned and inserted in the FRC. The .update code is triggered in…
Dave
  • 71
  • 10
0
votes
1 answer

Implementing fetchedresultsviewcontroller in Swift 3

I'm trying to implement fetchedresultsviewcontroller in Swift 3 and am running into the following error when setting the delegate property of the controller to self: Cannot assign value of type 'SomeRootViewController' to type …
0
votes
0 answers

Selected row 'spontaneously' resets to default values in FetchedResultsController

I have a TableViewController class that implements UITableViewController and NSFetchedResultsController protocols. On selecting a row, the app is designed to segue to a detail screen. However, when I first select any row other than the first, the…
Dave
  • 71
  • 10
1 2 3
99
100