Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 748453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:19:20+00:00 2026-05-14T14:19:20+00:00

I get stuck in some problem and after 2 days of seeking I’ve found

  • 0

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)
    return fetchedResultsController;

NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Profile"
                                          inManagedObjectContext:self.managedObjectContext];
[fetchRequest setEntity:entity];
[fetchRequest setFetchBatchSize:20];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastName" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];

NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc]
                                                         initWithFetchRequest:fetchRequest
                                                         managedObjectContext:self.managedObjectContext
                                                         sectionNameKeyPath:nil
                                                         cacheName:@"Root"];
aFetchedResultsController.delegate = self;
self.fetchedResultsController = aFetchedResultsController;
NSError *error = nil;
//[aFetchedResultsController performFetch:&error];

[aFetchedResultsController release];
[fetchRequest release];
[sortDescriptor release];
[sortDescriptors release];

return fetchedResultsController;

}

Have a look at commented string – there wasn’t any of these strings and when I asked for data – I didn’t get any (and it was there!). When I’ve uncommented that line, it starts work. Seems evident, but all examples I saw before hadn’t that line. And they work. How can it be? I just want to know what am I doing wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:19:20+00:00Added an answer on May 14, 2026 at 2:19 pm

    [aFetchedResultsController performFetch:&error]; has to be called at some point in order for the data to be fetched. The examples probably fetched the data at some point other than the accessor (it’s fine in the accessor, though).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've stuck into some weird problem. Here is the code AccountsController.cs // GET /api/accounts
I'm having a strange problem with ZeroMQ, in which some messages get stuck, and
I have google'd it, and tried some examples, but I always get stuck. This
I would like to achieve the following but after days of trial I still
I'm trying to write a Linux kernel module, but I'm stuck just writing some
I was hoping for some help on this as I'm really stuck after trying
I get stuck with a strange PHP behaviour after a cast. Here is the
I have problem and don't know how to get some clues on what might
Okay, I'm kinda stuck on really silly problem, but still can't figure out. I'm
I am in need for some help as I am stuck with a problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.