• 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
How to get an NSWindow from an NSDocument?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get an NSWindow from an NSDocument?


  • Subject: How to get an NSWindow from an NSDocument?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Mon, 23 May 2005 17:56:25 +0100

I have a document based Cocoa app.

I want to do stuff to it's window, like set the title of the window when I open a file. However, I can't figure out how to get an NSWindow from the NSDocument. I tried this:


- (NSWindow*) window { // from a subclass of NSDocument NSArray* a = [self windowControllers]; NSWindowController* wc = [a objectAtIndex:0]; NSWindow* w = [wc window]; return w; }

But I get an error that the NSArray actually contains no window controllers. What was I doing wrong?

--
elfdata.com/plugin/ Industrial strength string processing, made easy.

"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."

_______________________________________________
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: How to get an NSWindow from an NSDocument?
      • From: Scott Ellsworth <email@hidden>
    • Re: How to get an NSWindow from an NSDocument?
      • From: Ofri Wolfus <email@hidden>
    • Re: How to get an NSWindow from an NSDocument?
      • From: John Timmer <email@hidden>
  • Prev by Date: ANN Testers Wanted
  • Next by Date: Re: RAM Location and Size in 64bits Machines
  • Previous by thread: ANN Testers Wanted
  • Next by thread: Re: How to get an NSWindow from an NSDocument?
  • Index(es):
    • Date
    • Thread