• 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: Object from valueForKey is invalid
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object from valueForKey is invalid


  • Subject: Re: Object from valueForKey is invalid
  • From: Theo Vosse <email@hidden>
  • Date: Tue, 27 Sep 2005 14:57:20 +0200

Hi,

Last week, I wrote

I've created a slightly strange mixture of my own document structure
and an NSPersistentDocument with a controller, an unholy marriage,
some might say.
...
The problem is that I cannot obtain the text from inside the program.
... The number of selected sentences seems to be correct,
but the object that ends up in the variable "text" is invalid (i.e.,
it is an NSCFString object, whose description is "Invalid").

Nobody responded, and I still don't know what caused the problem, but I did find a way around it.


Instead of adding an instantiation of a (sub-class of) NSPersistentDocument to the nib file, I made the file owner a delegate for managedObjectContext and managedObjectModel, much like the CoreData template in XCode does (but without the implicit use of a file that is in the template), and bound the array controller to the file owner object. That did the trick.

I still have a question though: how come the objects appear in a different order, each time I open the (same) document?

    Theo
_______________________________________________
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: Object from valueForKey is invalid
      • From: Chris Hanson <email@hidden>
  • Prev by Date: CFMessagePort to NSMessagePort in IM context?
  • Next by Date: add selectors to a class
  • Previous by thread: Object from valueForKey is invalid
  • Next by thread: Re: Object from valueForKey is invalid
  • Index(es):
    • Date
    • Thread