• 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
KVO: NSObjectController won't contain File's Owner attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO: NSObjectController won't contain File's Owner attribute


  • Subject: KVO: NSObjectController won't contain File's Owner attribute
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 1 May 2006 17:13:29 -0500

I am having a pattern of errors in which an NSObjectController does not point its content at an instance variable of the NIB's owner.


The summary of the NIB is

File's Owner is a MyDocument (NSPersistentDocument).

Document is an NSObjectController whose content outlet points to File's Owner, and whose content type is class MyDocument. Automatically prepares content.

MarineData is an NSObjectController, content type entity ChannelizedData. Bound to property marineData of the Document controller. Automatically prepares content. ManagedObjectContext bound to File's Owner -> managedObjectContext.

There's an array controller bound to a property of MarineData, but this seems not to be relevant.

There are 24 root-level objects in the NIB.


I added outlets for the Document and MarineData controllers so I could observe them in the debugger.


Upon entering windowControllerDidLoadNib:, controllers Document and MarineData are both NSObjectControllers. Document controller has the content you'd expect.
MarineData controller has nil content (this is the surprise, and the bug I'm prosecuting).
The application behaves as though MarineData has no content. The underlying MyDocument has a marineData instance variable, and it is non-nil. Intercepting the marineData accessor shows it is called during initialization.


This is the case whether MyDocument.marineController has explicit KV accessors or not.


This is part of a pattern, in that I've seen the same sort of behavior before. The bug went away when I wiggled things around -- doing things like renaming instance variables. I don't remember which of my changes corrected the problem, only that I was down to desperate measures (i.e. wiggling things around).


The problem is probably conceptual on my part, in which case all this detail is a red herring (except insofar as it narrows the problem down to my missing something).

Can anyone help, please?

	-- F


-- Fritz Anderson -- http://www.manoverboard.org/ Consulting Programmer -- http://resume.manoverboard.org/ Step into Xcode, Now Available -- http://six.manoverboard.org/


_______________________________________________ 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: KVO: NSObjectController won't contain File's Owner attribute
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Getting notified on tab-switch in Safari?
  • Next by Date: Re: Animated split view collapsing
  • Previous by thread: Re: OffTopic: Progress bar slows down the system
  • Next by thread: Re: KVO: NSObjectController won't contain File's Owner attribute
  • Index(es):
    • Date
    • Thread