• 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
Re: CoreData and NSObjectController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData and NSObjectController


  • Subject: Re: CoreData and NSObjectController
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 8 Mar 2009 10:37:45 -0700

On Mar 8, 2009, at 10:14, Michael Süssner wrote:

I have started to experiment with the core data framework and have run immediately into a problem.

I have modelled a data entity "Person" and setup a window in IB which displays all parameters of a single data record. Then I have added a button which calls the add: method of the PersonController Object, IB has created.

When I execute the program and click on the add button, the controller creates a new data record and I can enter the attributes. If I press again the button, the add method is called, but no new record is created.

I have subclassed the controller object and learned that the canAdd: method returns false after I press the button the second time.

What have I done wrong? Which action does the controller expect?

If you're trying to create multiple Persons, you should be using a NSArrayController, not a NSObjectController.


The documentation sort of explains the behavior you're seeing for NSObjectController:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/CntrlContent.html#/ /apple_ref/doc/uid/TP40002147-183285-BBCDFJHD

(in the second paragraph)._______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >CoreData and NSObjectController (From: Michael Süssner <email@hidden>)

  • Prev by Date: CoreData and NSObjectController
  • Next by Date: Re: Making a border-less window is not working
  • Previous by thread: CoreData and NSObjectController
  • Next by thread: CoreData and NSObjectController
  • Index(es):
    • Date
    • Thread