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

  • Home
  • SEARCH
  • 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 8875183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:54:45+00:00 2026-06-14T18:54:45+00:00

I am trying to make a save button for my CoreData project, and usually

  • 0

I am trying to make a save button for my CoreData project, and usually I have no issues. But this time I am not seeing it save to the SQL file (using SQLite in FireFox) nor can I pull the data back in a UITableView.

There are no errors or warnings. Can someone help me with my clouded sunday afternoon (NZ time) head)??

- (IBAction)saveDataAction:(id)sender
{
//Instantiating the Entity with a pointer and giving it a mission.
NSString *details = @"Details";
NSManagedObject *newObject = [NSEntityDescription insertNewObjectForEntityForName:details inManagedObjectContext:[self managedObjectContext]];

int yearOfBirth = [_yearTxtField.text intValue]; //Converting the value from a String into an int
NSNumber *year = [NSNumber numberWithInt:yearOfBirth]; //Converting the int into a NSNumber

//Setting each textField value to an attribute in the Entity.
[newObject setValue:_nameTxtField.text forKey:@"name"];
[newObject setValue:_streetTxtField.text forKey:@"streetName"];
[newObject setValue:_cityTxtField.text forKey:@"cityName"];
[newObject setValue:year forKey:@"yearOfBirth"];

//This log just shows what has been added to the database.
//NSLog(@"Details Save:\n\n Name: %@\n StreetName: %@\n CityName: %@\n Year of birth: %@", details.name, details.streetName, details.cityName, details.yearOfBirth);
}
  • 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-14T18:54:47+00:00Added an answer on June 14, 2026 at 6:54 pm
    - (IBAction)saveDataAction:(id)sender
    {
         //Instantiating the Entity with a pointer and giving it a mission.
        NSString *details = @"Details";
        NSManagedObjectContext *context = [self managedObjectContext];
        NSManagedObject *newObject = [NSEntityDescription insertNewObjectForEntityForName:details inManagedObjectContext:context];
    
        int yearOfBirth = [_yearTxtField.text intValue]; //Converting the value from a String into an int
        NSNumber *year = [NSNumber numberWithInt:yearOfBirth]; //Converting the int into a NSNumber
    
        //Setting each textField value to an attribute in the Entity.
        [newObject setValue:_nameTxtField.text forKey:@"name"];
        [newObject setValue:_streetTxtField.text forKey:@"streetName"];
        [newObject setValue:_cityTxtField.text forKey:@"cityName"];
        [newObject setValue:year forKey:@"yearOfBirth"];
    
        NSError *error;
        if (![context save:&error]) {
            NSLog(@"Whoops couldn't save new object");
        }
        //This log just shows what has been added to the database.
        //NSLog(@"Details Save:\n\n Name: %@\n StreetName: %@\n CityName: %@\n Year of birth: %@", details.name, details.streetName, details.cityName, details.yearOfBirth);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to make a small countdown timer in my app but it's not working.
I am trying to make the save button visible when text is entered into
I have a button tag with two spans inside; <button><span><span id=buttonText>Save</span></span></button> I'm trying to
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a simple number clicker control for BlackBerry 6/7, like this: At
I'm trying to make our popup messages boxes have more appropriate text, rather than
i'm trying to make a small project that uses multiple forms (dialogs) for different
I have been trying to make a updateable grid.Which means i show an icon
1st Question: I'm trying to make the create method work, but it appears that
i am trying to make a file in javascript, but it doesn't be saved

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.