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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:18:18+00:00 2026-06-09T06:18:18+00:00

Hi I am fairly new to core data and have recently started doing some

  • 0

Hi I am fairly new to core data and have recently started doing some tutorials. I have successfully added new data via core data but am struggling to overwrite the data. I have a textfield where I want to be able to save the text written in that textfield to core data. This is how I have added new data. Can anyone lead me in the right direction?

Thank you

P.S. I believe it has to do with the way I do “insertNewObjectForEntityForName”

-(IBAction)saveData
{

AppDelegate *appDelegate = 
[[UIApplication sharedApplication] delegate];

NSManagedObjectContext *context = 
[appDelegate managedObjectContext];
NSManagedObject *newContact;
newContact = [NSEntityDescription
              insertNewObjectForEntityForName:@"Gameinfo"
              inManagedObjectContext:context];
[newContact setValue:[self valuefromtextfield] forKey:@"score"];
//[newContact setValue:@"mark" forKey:@"currentLevel"];
NSError *error;
[context save:&error];

 }
  • 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-09T06:18:20+00:00Added an answer on June 9, 2026 at 6:18 am

    When you use insertNewObjectForEntityForName you are creating a NEW entity. If you want to edit an existing entity you need to

    AppDelegate *app = [[UIApplication sharedApplication] delegate]
    NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Gameinfo"];
    NSError *error = nil;
    NSArray *someArray = [app.managedObjectContext executeFetchRequest:request error:&error];
    

    Then someArray has all of the entities named Gameinfo in it. Find the one you want and edit whatever properties you want. Then call save on the managed object context.

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

Sidebar

Related Questions

So I'm fairly new to Core Data and KVO, but I have an NSManagedObject
I am fairly new to Core Data and have run into an issue which
I am fairly new to Core Text but have been getting on well, however
I am fairly new to core data technology and i searched a lot on
I am fairly new to php and mysql but I have created a small
I'm fairly new to the more complex parts of Core Data. My application has
Fairly new to Jquery here.... but one thing I have been told and being
I have a fairly simple application using Core Data, and a couple Array Controllers
I'm fairly new to core data and iphone programming. Maybe this is an obvious
Fairly new to iPhone dev. My app uses Core Data, and at one point

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.