• 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: NSWindowController to manage two NSWindow instances
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindowController to manage two NSWindow instances


  • Subject: Re: NSWindowController to manage two NSWindow instances
  • From: Mirko Viviani <email@hidden>
  • Date: Sat, 4 Aug 2007 10:17:52 +0200

On Aug 4, 2007, at 12:24 AM, Chris Hanson wrote:

I want to use a single NSWindowController to manage two different instances of NSWindow, one at a time.
To do that I use the NSWindowController -setWindow: method to swap instances but after doing that the NSWindow
delegate methods are not anymore called.
The first time they are called but not after swapping.

Why do you want to do that, rather than have separate NSWindowController instances, one for each window?

I do that because it's the same document and controls with _only_ a different kind of visualization
(fullscreen instead of a regular window) and I can't reuse the same window to switch to fullscreen due
to impossibility to change the styleMask.


Cocoa assumes quite strongly that the relationship between NSWindowController and NSWindow is one-to-one, in both directions. If you try to use one NSWindowController instance to manage multiple NSWindow instances, or if you try to use multiple NSWindowController instances to manage one NSWindow instance, you'll end up fighting the framework a lot and writing lots of relatively fragile code.

No, I don't need to manage multiple window but only to switch the window instance: fullscreen<->regular window
Anyway I have to rethink at it since I am not satisfied by the design... probably I'll remove the
NSWindowController dependency.


To solve my problem I just had to clear and reset the window's delegate.

--
Ciao,
Mirko


_______________________________________________

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: 
 >NSWindowController to manage two NSWindow instances (From: Mirko Viviani <email@hidden>)
 >Re: NSWindowController to manage two NSWindow instances (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: webloc files
  • Next by Date: Re: How to apply arguments to .app application while starting it on Terminal?
  • Previous by thread: Re: NSWindowController to manage two NSWindow instances
  • Next by thread: Thread Communication Conceptual Question
  • Index(es):
    • Date
    • Thread