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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:06:56+00:00 2026-06-12T07:06:56+00:00

The following shows a method that I have added to a subclass of NSManagedObject

  • 0

The following shows a method that I have added to a subclass of NSManagedObject to populate and add individual entities to Core Data. I have about a 1000 objects to add to the data base (which I am doing in a loop, not a list as shown below) My question is with regards to performance, does adding each of the 1000 objects 1 by one add a significant overhead to the Core Data (I would assume it does). Is there a way to store each of the managed objects and them add them in a single (faster) way.

NSManagedObjectContext *context = [[self managedDocument] managedObjectContext];
[Atomal createAtomalInContext:context withName:@"H11" age:@57 andType:@"Nantar"];
[Atomal createAtomalInContext:context withName:@"H23" age:@22 andType:@"Nantar"];
[Atomal createAtomalInContext:context withName:@"H54" age:@11 andType:@"Nantar"];
[Atomal createAtomalInContext:context withName:@"H34" age:@98 andType:@"Nantar"];
[Atomal createAtomalInContext:context withName:@"H17" age:@35 andType:@"Nantar"];

.

+ (Atomal *)createAtomalInContext:(NSManagedObjectContext *)context withName:(NSString *)name age:(NSNumber *)age andType:(NSString *)type {
    Atomal *atomal = nil;
    atomal = [NSEntityDescription insertNewObjectForEntityForName:@"Atomal" inManagedObjectContext:context];

    // POPULATE PROPERTIES
    [atomal setName:name];
    [atomal setAge:age];
    [atomal setType:type];
    NSLog(@"CORE: Adding >>> %@ %@ %@", [atomal name], [atomal age], [atomal type]);
    return atomal;
}
  • 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-12T07:06:57+00:00Added an answer on June 12, 2026 at 7:06 am

    This should be fine. If you are really worried about performance and you are actually having issues with your implementation then you should profile and get real results to work on instead of just asking for opinions.

    In saying that this should be fairly inexpensive as all of the managed object are created in memory – it will be when you call save: that Core Data starts to hit the disk. The IO of hitting the disk is the slow part so if you make sure you keep that to a minimum you should be fine.

    Again one of the more expensive things you are doing here is logging, which is IO outputting to a log, you can really notice this effect if you do a lot of logging in a tight loop.

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

Sidebar

Related Questions

I want to have the following method not show a warning about using raw
I have the following relationship defined in Core Data Person --> Worked <-- Job
can someone please show me documentation on this method? i have the following line:
The following code shows a button that allows you to select a file (should
The following code shows what I currently have. It is an adapter for circular
I have an activity that shows customer information. All the controls are drawn dynamically
I've run into a problem with an iPhone core data application that I'm working
I added a reference to the System.Core assembly. The web.config now has: <add assembly=System.Core,
I have a form with multiple fields that I'm validating (some with methods added
I'm developing a Core Data app that uses a model object called Location. 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.