Re: Creating NSViewController with -init.
Re: Creating NSViewController with -init.
- Subject: Re: Creating NSViewController with -init.
- From: Kyle Sluder <email@hidden>
- Date: Tue, 25 Mar 2014 11:25:24 -0700
On Tue, Mar 25, 2014, at 11:08 AM, Keary Suska wrote:
> Yes, and yes, but also it is documented to not throw an exception is
> setView: is used before the view is loaded, which the OP must be using to
> avoid the exception.
The whole point is that he's not. Try it for yourself.
@interface SomeViewController : NSViewController
@end
@implementation SomeViewController
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
SomeViewController *vc = [[SomeViewController alloc] init];
[_window.contentView addSubview:vc.view];
}
@end
Does not throw an exception, as long as SomeViewController.xib exists
and has a view hooked up to First Responder's view outlet.
--Kyle Sluder
_______________________________________________
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