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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:04:30+00:00 2026-05-25T11:04:30+00:00

Let’s suppose there is an entity called PERSON in a CoreData model and a

  • 0

Let’s suppose there is an entity called PERSON in a CoreData model and a NSPanel (displayed as a Sheet) is used to ask for the information needed to create an instance of such entity. The NSPanel also has a Save and Cancel buttons.

What would be the best way to implement this?

My current approach is to create the NSPanel and add outlets to NSTextField’s corresponding to the FirstName and LastName attributes of the PERSON Entity.

For the Save button I’ve created a Save Action that “reads” the data entered by the user through the Outlets and manually create a PERSON Entity with the provided information.

For the Cancel button, I’ve created a Cancel Action that just closes the NSPanel.

Even though the whole thing works as intended, I find this approach messy. Things get even worse with the need to implement the Edit functionality since a new method is needed to read the data from the selected Entity and pass it to the NSTextField’s, and add the required logic to the Save Action to account for the update operation.

I wonder if a full CoreData/Binding approach is possible in this scenario?

The main issue with the Full CoreData/Binding approach, at least to my short experience on these frameworks, is the fact that once the user start entering the info on a new instance, is already to late Cancel operation. Right?

  • 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-25T11:04:31+00:00Added an answer on May 25, 2026 at 11:04 am

    The setup you describe is by no means messy. Rather, it provides ample opportunity to enhance the UI experience.

    Your last point, or “main issue”, is not a problem at all. You can put up the NSPanel and have the user input new values, and simply dismiss them if Cancel is pressed. Only if the Save button is pressed do you insert a new object into the core data managedObjectContext and save.

    Similarly, when editing you simply retrieve the data before and populate the fields. You keep a reference to the record, if Save is pressed you modify the attributes and save the managedObjectContext. If the operation is canceled you simply discard the reference.

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

Sidebar

Related Questions

Ok, let's suppose we have members table. There is a field called, let's say,
Let's suppose I retrieve an entity $e and modify its state with setters: $e->setFoo('a');
Let's suppose there is an underformed triangle ABC in 2D. There is a point
Let's suppose there is a table user id_user | name | id_state 1 |
Let's suppose there is an <img> element that has some onclick event handler. For
Suppose there's a java webapp that let users upload image files, it simply stores
For example I have a wpf window bound to an customer Entity (let suppose
Is there a way to fill an ITemplate by code? Let's suppose I have
Let us suppose i have these three methods defined: int F1(int, int); int F1(float,
Suppose we need to check three boolean conditions to perform a select query. Let

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.