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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:17:33+00:00 2026-05-15T11:17:33+00:00

I am saving an NSMutableArray in a Transformable property in my Core Data store.

  • 0

I am saving an NSMutableArray in a Transformable property in my Core Data store. I can create the entity properly with data in the NSMutableArray and then load it out of the property, and even make changes. When I go around my app and re-access it, my changes are saved. However when I reload the app, the changes have not saved in the core data store. Other changes to the entity – e.g. changing its title, which is saved as an NSString – are saved even when I quit and re-open the app.

I read in another StackOverflow question that Transformable attributes are not automatically notified of changes, and that I’d have to call “the appropriate setter before saving”. However even using the actual setter functions – I have also tried calling didChangeValueForKey – the property is not saved properly. Any good ideas?

  • 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-15T11:17:33+00:00Added an answer on May 15, 2026 at 11:17 am

    You must, as you note, “re-set” a transformable property:

    id temp = [myManagedObject myTransformableAttribute];
    
    //.. do something with temp
    
    [myManagedObject setMyTransformableAttribute:temp];
    

    There is no way that Core Data could appropriately monitor an arbitrary transformable object so that it could ‘do the right thing’ automatically.

    Furthermore, you must be certain that you actually save the managed object context after you modify the transformable attribute:

    NSError *error;
    if(![[myManagedObject managedObjectContext] save:&error]) {
      //present error
    }
    

    During a single run of the program, unsaved changes will appear visible because the managed object context keeps modified instances in memory. Without saving the context, however, those changes will not be persisted to disk.

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

Sidebar

Related Questions

When saving a new entity something strange happens... I have a data grid with
I'm saving some data using a series of NSDictionaries, stored in an NSMutableArray and
I am getting data from NSTextField, and saving data in NSMutableArray. I want to
I am saving various entities into core data. Each time I need to access
Saving a Word 2003 document to XML and then back results in a reduced
between saving a key name like this for(var key in this.data) { var key_name
I'm saving data to a table, but I also need a column with a
My writeToFile is not saving my data to my .plist. - (IBAction)clickBtnDone:(id) sender {
My application has multiple view controllers. In my VehicleListController I am saving the data
I'm quite new with Core Data, and I'm having an issue that I don't

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.