• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreData and Bindings - a single, simple entity with bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData and Bindings - a single, simple entity with bindings


  • Subject: CoreData and Bindings - a single, simple entity with bindings
  • From: Marcus Roberts <email@hidden>
  • Date: Sun, 1 May 2005 09:59:49 +0100

I've been trying out CoreData, reading through the excellent
cocoadev.com tutorials, and the documentation on Apple's developer
site.    All of the examples so far link an interface of tables
through NSArrayControllers back to the managed context.  These all
work fine.

What I'm trying to do is instantiate a single entity object in a
document.  Taking it back to basics, I defined an entity in the data
model, with two fields, name and email.  I then option-click and drag
the entity onto a new empty document window in Interface Builder, and
when asked, choose One Object instead of Many Objects.

When I run the application created, the document window appears, with
two empty fields, but the document data is marked as needing to be
saved, as the red window close button has the dark dot in the middle.
If I type into each text field, then press Apple-Z to undo, the two
fields clear in turn, and then they become disabled with "No
Selection" written in them.

I'm not quite sure what's happening here.  In an equivalent 10.3
program, I would have instantiated a model object, and using bindings
and an NSObjectController linked the view to the model.   The document
wouldn't need saving until the user typed values into the field.

Can anyone explain the behaviour - I'm guessing it's probably pretty
simple, and to do with the managed context's behaviour in creating an
entity object, but I'm not sure.  Or is it more complex, and due to
needing a graph of objects rather than just a single object?

Thanks

Marcus
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: CoreData and Bindings - a single, simple entity with bindings
      • From: Tom Birch <email@hidden>
    • Re: CoreData and Bindings - a single, simple entity with bindings
      • From: Marcus Roberts <email@hidden>
  • Prev by Date: Preferences file in Tiger
  • Next by Date: Re: Archiving's Future?
  • Previous by thread: Re: Preferences file in Tiger
  • Next by thread: Re: CoreData and Bindings - a single, simple entity with bindings
  • Index(es):
    • Date
    • Thread