Re: NSWindow from code
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