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 6608829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:39:04+00:00 2026-05-25T19:39:04+00:00

req = [[NSFetchRequest alloc] init]; // entity ent = [NSEntityDescription entityForName:@Medicine inManagedObjectContext:context]; [req setEntity:ent];

  • 0
    req = [[NSFetchRequest alloc] init];

    // entity
    ent = [NSEntityDescription entityForName:@"Medicine" inManagedObjectContext:context];
    [req setEntity:ent];

    // predicate
    pred = [NSPredicate predicateWithFormat:@"date > %@",referenceDate];
    [req setPredicate:pred];

    // sort descriptor
    sorter = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES];
    [req setSortDescriptors:[NSArray arrayWithObjects:sorter, nil]];

    NSFetchedResultsController *frc = [[NSFetchedResultsController alloc] initWithFetchRequest:req managedObjectContext:context sectionNameKeyPath:@"date" cacheName:@"asdsad"];
    NSLog(@"%@",[frc fetchedObjects]); // returns (null)

    //NSArray *frc = [context executeFetchRequest:req error:nil];
    //NSLog(@"%@",frc); // returns 4 objects

As you can see by my code I’ve got two different bits at the end.

The first code (uncommented) returns null in the NSLog.

The second code (commented) returns an array of 4 objects from the context.

Any reason why this is happening? Am I doing something 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-25T19:39:05+00:00Added an answer on May 25, 2026 at 7:39 pm

    Because you need to do one more thing: performFetch.

    Here’s the details in the docs:

    performFetch:
    Executes the receiver’s fetch request.

    • (BOOL)performFetch:(NSError **)error
      Parameters
      error
      If the fetch is not successful, upon return contains an error object that describes the problem.
      Return Value
      YES if the fetch executed successfully, otherwise NO.

    Discussion
    After executing this method, you can access the receiver’s the fetched objects with the property fetchedObjects.

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

Sidebar

Related Questions

Quite simple really: var req:URLRequest=new URLRequest(); req.url=http://somesite.com; var header:URLRequestHeader=new URLRequestHeader(my-bespoke-header,1); req.requestHeaders.push(header); req.method=URLRequestMethod.GET; stream.load(req); Yet,
I need to know this since this is a pre-req for .NET 3.5 and
I have a req where in i have to create a worker thread and
SELECT count(distinct req.requirementid), req.requirementid, org.organizationid, req.locationofposting, org.registereddate FROM OrganizationRegisteredDetails AS org, RequirementsDetailsforOrganization AS req
function addRequest(req) { try { request = new XMLHttpRequest(); } catch (e) { try{
lStrABC = UTIL_COMMON.fnGetValue(req.getParameter(ABC)); hi, please help to define the above code? the ABC is
I am using this code: def req(url, postfields): proxy_support = urllib2.ProxyHandler({http : 127.0.0.1:8118}) opener
I've have some code similar to this: HttpWebRequest req; HttpWebResponse response; Stream receiveStream =
As per req i have to create stl queue on heap i have created
The following request to openssl hangs openssl req -key server.key -out server.csr Any idea

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.