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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:21:00+00:00 2026-06-16T20:21:00+00:00

I’m working on a project where I many view controllers and each one it

  • 0

I’m working on a project where I many view controllers and each one it is based on Core data and UITableView. I have problem with saving, when we editing table we should store current info and data. Next if user tapped ‘Save button everything should go into masterContext in appDelegate class (and only then, so we couldnt save dynamicaly in masterContext!).

My question is the following. How can I save current data if the user has tapped the save button passing it to the masterContext? Should I create temporaryContext and than merge it with masterContext?

Thanks for your answers.

  • 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-16T20:21:01+00:00Added an answer on June 16, 2026 at 8:21 pm

    Based on your question, you don’t need to have multiple contexts and then share their changes with the master one. Use only a master context that you share among different controllers. Usually this is ok.

    Here two approaches are valid.

    • Pass the baton approach
    • Create a singleton class where you can retrieve the context

    The first approach means that you can pass the context among controllers as a sort “of code injection”.

    controller1.masterContext = [self masterContext];
    

    where masterContext is a strong property for controller1.

    The second approach means that in the class where you set up the Core Data stack (usually the application delegate) you provide a readonly property through which you can access the context. You can also provide a save method to save the context. I don’t like very much to put all the set up code in the application delegate and so, I usually create a singleton class for this purpose. DCTCoreDataStack is an example of this.

    @MarcusZarra in PASSING AROUND A NSMANAGEDOBJECTCONTEXT ON IOS shows also some techniques to pass the context around.

    If are interested in you can also use new iOS 5 APIs in Core Data and set up a master context that works in a private queue (NSPrivateQueueConcurrencyType) and a child that works on the main thread (NSMainQueueConcurrencyType). This is called parent/child context. Changes done in the main thread are passed to the master that will save changes in the CD store. Here some notes. Core Data Release Notes. In addition take a look at Multi-Context CoreData for a complete explanation.

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

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.