• 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: Faulty NSWindow connection in CoreData doc-based app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faulty NSWindow connection in CoreData doc-based app?


  • Subject: Re: Faulty NSWindow connection in CoreData doc-based app?
  • From: James DiPalma <email@hidden>
  • Date: Thu, 4 Aug 2005 11:01:13 -0700

I think your problem is here:

On Aug 4, 2005, at 11:33 AM, Cameron Hendrix wrote:
Is this a bug with the core data document template? No error is generated by the compiler or at runtime when I send a message to "window" (yes, I added IBOutlet NSWindow * window; to the MyDocument.h file). Also, I've tried it on two separate computers and the same thing seems to happen on both.

NSDocument has no window outlet, but it does have a setWindow: method that is documented to "Gets the window outlet hooked up from Interface Builder in the case where the document is the nib file’s owner." Sounds good, but when your nib file is loaded, your window outlet (properly established in IB) is connected by calling setWindow: which will not set your window ivar. This behavior is probably unexpected (*).


On Aug 4, 2005, at 10:30 AM, Charilaos Skiadas wrote:
What do you mean: "does not seem to be working"? How are you testing it?

You can test if your window outlet is set correctly by testing if it is nil. Your described behavior sounds a lot like nothing is happening and that behavior is commonly an IBOutlet that is still set to nil when being used.



-jim



(*) I am disappointed that NSDocument was designed this way, but without changes to IB that allow making an array connection that passes through something like addWindow: instead of setWindow:, what could they have done? I use setAddWindow: in a similar situation, which avoids conflict with a subclass' window ivar, but is awkward at best.

_______________________________________________
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


References: 
 >Faulty NSWindow connection in CoreData doc-based app? (From: Cameron Hendrix <email@hidden>)
 >Re: Faulty NSWindow connection in CoreData doc-based app? (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: NSMetadataItem performance issues
  • Next by Date: Re: Basic instinct
  • Previous by thread: Re: Faulty NSWindow connection in CoreData doc-based app?
  • Next by thread: Re: Faulty NSWindow connection in CoreData doc-based app?
  • Index(es):
    • Date
    • Thread