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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to