• 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: How do I prevent initWithFrame (NSView) being called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I prevent initWithFrame (NSView) being called?


  • Subject: Re: How do I prevent initWithFrame (NSView) being called?
  • From: Aram Greenman <email@hidden>
  • Date: Sun, 23 Jun 2002 17:37:07 -0700

On Sunday, June 23, 2002, at 04:30 PM, Hisaoki Nishida wrote:


Like you suggested, I implemented an awakeFromNib method in my custom window class.
But the initWithFrame method would be called anyway, even if I go full-screen.

I think I wasn't clear -- you should implement -awakeFromNib in your controller, not your custom view. The window and view should be in a separate nib file which is only loaded if you read the user defaults and determine it is going to be used.


If you have an NSView in a nib file, -initWithFrame: will be sent to the view when it is loaded, no way around it. And overriding -initWithFrame: with an implementation that doesn't [super initWithFrame:] is not a good idea for obvious reasons.

- but, since what you want to do is not create a window at all for full-screen mode, then the -awakeFromNib: method which reads the user defaults should belong to a controller, not the custom view. If the user wants full-screen mode, set your context to full screen, if they want a window, load the window's nib file and assign the context to the view in that window.

I don't know where you are creating your context, but since it will sometimes live in a view and sometimes in full screen mode, then the context should be created independent of your custom view class.


aram
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How do I prevent initWithFrame (NSView) being called? (From: Hisaoki Nishida <email@hidden>)

  • Prev by Date: Re: CDSA - they really don't want anyone to use it this bad?!?
  • Next by Date: CoreGraphics/Quickdraw Bug in OS X?
  • Previous by thread: Re: How do I prevent initWithFrame (NSView) being called?
  • Next by thread: Rollover buttons
  • Index(es):
    • Date
    • Thread