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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:54:04+00:00 2026-06-12T01:54:04+00:00

I want a thorough list regarding comparison between the two. Things I have known:

  • 0

I want a thorough list regarding comparison between the two. Things I have known:

executeFetchRequest:

  • Message sent to MOC
  • Return an array of managed objects
  • Goal: fetch objects from persistent store to MOC
  • With table view: has nothing to do with table view
  • Frequency: often used in a loop, so could be called many many times

performFetch:

  • Message sent to FRC
  • After calling it, use fetchedObjects to return an array of managed objects
  • With table view: FRC is specifically for keeping managed objects and table view rows in sync, and use performFetch to initialize that process.
  • Frequency: often only once. Unless fetch request of FRC changes, no need to call performFetch a second time

Please correct me if I am wrong and append the list. Thank you.

  • 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-06-12T01:54:05+00:00Added an answer on June 12, 2026 at 1:54 am

    About executeFetchRequest:

    Message sent to MOC

    Yes

    Return an array of managed objects

    Yes, but you can also change the type of results you want to retrieve. In NSFetchRequest you can set a different result type with:

    - (void)setResultType:(NSFetchRequestResultType)type
    

    where NSFetchRequestResultType can be of different types. Taken from Apple doc:

    enum {
       NSManagedObjectResultType        = 0x00,
       NSManagedObjectIDResultType      = 0x01,
       NSDictionaryResultType           = 0x02
       NSCountResultType                = 0x04
    };
    typedef NSUInteger NSFetchRequestResultType; 
    

    Goal: fetch objects from persistent store to MOC

    Yes, creating a NSFetchRequest and performing a request, it the same as creating a SELECT statement in SQL. If you also use a NSPredicate it’s the same as using SELECT-WHERE statement.

    With table view: has nothing to do with table view

    Yes, but with retrieved data you can populate a table

    Frequency: often used in a loop, so could be called many many times

    It depends, on what you want to achieve. It could be within a loop or not. Executing the request within a loop could have impact on performance but I would not be worried on that. Under the hood Core Data maintains a sort of cache mechanism. Every time you perform a request, if data are not in the cache, Core Data executes a round trip on your store (e.g. sql file) and populate the cache with the objects it has retrieved. If you perform the same query, the round trip will not performed again due to the cache mechanism. Anyway, you could avoid to execute a request within the run loop, simply moving that request outside the loop.

    About performFetch:

    Message sent to FRC

    Yes

    After calling it, use fetchedObjects to return an array of managed
    objects

    Yes, but you can also retrieve an object with [_fetchedResultsController objectAtIndexPath:indexPath]; if you are populating a specific cell within a table.

    Here I really suggest to read a nice tutorial on NSFetchedResultsController

    With table view: FRC is specifically for keeping managed objects and
    table view rows in sync, and use performFetch to initialize that
    process.

    Yes, a NSFetchedResultsController works in combination with a NSManagedObjectContext for you. Furthermore, it enables lazy loading of data. Suppose you have 1000 elements you retrieve and you want to display them in a UITableView. Setting a request for a NSFetchRequest like:

    [fetchRequest setFetchBatchSize:20];
    

    and using it with an instance of a NSFetchedResultsController, it allows to load 20 elements at first. Then when you scroll, other 20 elements are loaded, and so on. Without a NSFetchedResultsController you must implement this behavior manually. Refer to the tutorial I provided for further info.

    Frequency: often only once. Unless fetch request of FRC changes, no
    need to call performFetch a second time

    It depends on what you want to achieve. Most of the time you could call it once.

    Hope that helps.

    Edit

    You have to call performFetch explicitly. I like to create a property for NSFetchedResultsController in my header file (.h) like

    @property (nonatomic, strong, readonly) NSFetchedResultsController* fetchedResultsController;
    

    and synthesize it in your implementation file (.m) like

    @synthesize fetchedResultsController = _fetchedResultsController;
    

    Then always within the .m file override the getter to create an new instance of it:

    - (NSFetchedResultsController*)fetchedResultsController
    {
        // it already exists, so return it
        if(_fetchedResultsController) return _fetchedResultsController;
    
        // else create it and return
    
        _fetchedResultsController = // alloc-init here with complete setup
    
       return _fetchedResultsController;
    }
    

    Once done, within your class (for example in viewDidLoad method) use it like

    NSError *error = nil;
    if (![[self fetchedResultsController] performFetch:&error]) {
    
        // Handle the error appropriately.
        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list that I want to loop through (for trimtemp in trim)
Here's a really simple question regarding pythonic coding. Given a list, if you want
Essentially I want to take a list of things like... a 345 b 762
I want to do two things: In production code, I want to redefine the
I want to loop through a database of documents and calculate a pairwise comparison
Suppose I have a list of strings where each string is exactly 4 characters
I have 3 different images and want to create a sprite using CSS. I
I want to iterate through a list of files without caring about what characters
I have a list of filenames which are like so: fw_d.log.1.gz through fw_d.log.300.gz When
So I have an interesting design question regarding an app I'm developing for the

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.