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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:50:13+00:00 2026-05-26T14:50:13+00:00

I am using Core data to enter song details in database. I have 3

  • 0

I am using Core data to enter song details in database. I have 3 views for this.. first is to select song name and its detail view to save details in database.. and third view is to display saved songs.. My App is saving data and sometimes giving exception.

I found when it is giving exception. If i select song and save it in database it is saving properly. But when I first go to 3rd view. Songlistviewcontroller and then open songs and try to save it details it gives exception on save line..

011-11-04 11:14:10.578 SongsWithLyrics[259:207] *
-[SongsListViewController controllerDidChangeContent:]: message sent to deallocated instance 0x5b73b50

Here is my code to save songs

//save song details
- (IBAction)saveDetails:(id)sender {

    NSError *error;
    self.song = [NSEntityDescription insertNewObjectForEntityForName:@"Song" inManagedObjectContext:managedObjectContext];


    [song setValue:songTitleString forKey:@"songTitle"];
    [song setValue:albumNameText.text forKey:@"albumName"];
    [song setValue:artistNameText.text forKey:@"artistName"];
    [song setValue:albumGenreText.text forKey:@"albumGenre"];
    [song setValue:UIImagePNGRepresentation(artworkImageview.image) forKey:@"artworkImage"];


    if (![managedObjectContext save:&error])
    {
        NSLog(@"Problem saving: %@", [error localizedDescription]);
    }



    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Saved" message:@"" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];
    [alert show];
    [alert release];

    [self.navigationController popViewControllerAnimated:YES];




}

I am stuck with the issue.. and can’t understand why this is happening.

Earlier my application flow was .. SongsListviewController->Songs->SaveSongs

and It was working fine.. for that.

Please help

  • 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-26T14:50:13+00:00Added an answer on May 26, 2026 at 2:50 pm

    There are several interesting ways Core Data gets “sneaky” on you and can keep references around to things that don’t exist anymore.

    In this case, an NSFetchedResultsController was the suspect.

    You set the NSFetchedResultsController’s delegate – and later got an update – except your delegate instance wasn’t around anymore to process that update.

    Some background:

    If you set a delegate for a fetched results controller, the controller
    registers to receive change notifications from its managed object
    context. Any change in the context that affects the result set or
    section information is processed and the results are updated
    accordingly. The controller notifies the delegate when result objects
    change location or when sections are modified (see
    NSFetchedResultsControllerDelegate). You typically use these methods
    to update the display of the table view.

    It’s important to make sure you nil-out any weak references when you set delegates like this (pre-ARC) because they don’t automatically zero – and they can break if left in place.

    The solution is simple; set the delegate to nil when your instance is getting deallocated.

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

Sidebar

Related Questions

I'm using core data and I have an entity defined called LogRecord. Elsewhere this
I have an application using Core Data and bindings. I want to have an
I'm using core data in my app. I have two entities that are related:
I've been creating an iPhone App using Core Data. First of all, does it
I have developed my app using core data. It works fine in the simulator.
I'm using Core data in an iOS project. I have the data model setup
I have just started using core data. I want to setup a pre-populated db.
I have the following setup using Core Data: Nib1: A WindowController with two custom
Using Core Data, I have my fetchedResultsController with a with a date field. I
I'm using core data and I have a simple two-entity model. My navigation controller

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.