• 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: NSWindow from code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow from code


  • Subject: Re: NSWindow from code
  • From: Graham Cox <email@hidden>
  • Date: Tue, 7 Apr 2009 09:22:14 +1000


On 07/04/2009, at 3:40 AM, Jan Bernard Marsman wrote:

From my subclass of an NSView I call the (simplified) following:
- openHUD {
   [NSButton * button] = <alloc & init>
   [NSWindow * w] = <alloc & init with some style>
   ...
   [[w contentView] addSubview: <button>]
   NSWindowController * nw = [NSWindowController initWithWindow:w];
   [nw showWindow:nil]
}


This sounds crazy - an NSView is opening a window? *Where* in NSView is this called from?

Apart from breaking fundamental design principles (MVC for example), why aren't you using Interface Builder? Don't fight the frameworks - unless you have a *VERY* good reason to build your UI in code, don't bother. Using IB is the path of least resistance, and is much easier than a) the alternatives and b) it looks.

--Graham


_______________________________________________

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: 
 >NSWindow from code (From: Jan Bernard Marsman <email@hidden>)

  • Prev by Date: Re: MVC pattern, bindings, and controllers
  • Next by Date: Re: Does waitUntilExit really mean that?
  • Previous by thread: NSWindow from code
  • Next by thread: Re: Re: NSWindow from code
  • Index(es):
    • Date
    • Thread