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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:34:32+00:00 2026-06-09T16:34:32+00:00

I am having two objects in my model: Person and Address. Person has a

  • 0

I am having two objects in my model: Person and Address. Person has a key name and a relationship to Address and Address has a key street.

I have designed the user interface to show a table with one column (Person.name) and two text fields with name and street.

I have created one NSArrayController with managedObjectContext set and ObjectController set to Entity and EntityName Person.

Running the app the table shows all added persons. The two text fields are connected to the Person-ArrayController via Bindings tab:

nameField with value:
Bind To: Person / Controller Key: selected / Model Key Path: name

streetField with value:
Bind To: Person / Controller Key: selected / Model Key Path: address.street

I am able to write something into name and it is stored persistently. I am also able to enter something into streetField but it is not stored.

Does anyone know why??

  • 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-09T16:34:33+00:00Added an answer on June 9, 2026 at 4:34 pm

    When the array controller creates the person object, something similar to below code happens:
    (assume moc is the AppDelegate managedObjectContext,also assume Person is the sub-class of NSManangedObject):

    Person *personObj = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:moc]; 
    personObj.name = @"something"; //some dummy values
    [personObj.address setValue:@"dummy address" forKey:@"street"];
    

    If personObj.address is logged , nil will be printed on the console.
    This is because the personObj.address is an Address object which till now has not been instantiated. Consequently personObj.address.street will be NULL.
    This is what happens in your case also.

    if you change the above code to the following it will work fine.

    Person *personObj = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:moc];
    
    //create an Address object and assign it to personObj.address (setting the relationship)
    personObj.address= [NSEntityDescription insertNewObjectForEntityForName:@"Address" inManagedObjectContext:moc]; 
    personObj.name = @"something"; //some dummy values
    [personObj.address setValue:@"dummy address" forKey:@"street"]; 
    

    and this can’t be done using binding.

    In short streetField bound to address.street doesn’t get any value because address doesn’t point to an instantiated object.

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

Sidebar

Related Questions

I'm having trouble with refreshing objects in my database. I have an two PC's
I have two list of different objects : List<Report> List<Newsletter> each having a 'created
I have two models class Status(models.Model) name = models.CharField(max_length=25) rank = models.PositiveSmallIntegerField() class MyModel(models.Model)
I'm having two DateTime -objects: $start = new DateTime('first thursday of June 2012'); $end
We are having two load balancing server. In that we have hosted a asp.net
I use an Entity Framework 4 edmx model that contains two entities having a
I have created domain model and define entities, value objects, Services and so on.
I have this JTable having an AbstractTableModel as its model. The initial contents are
I have two models. An Artist model, and a Album model. There's a ManyToManyField
I have a document based application running with core data. The object model has

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.