• 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: Creating NSViewController with -init.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Creating NSViewController with -init. (From: Kyle Sluder <email@hidden>)
 >Re: Creating NSViewController with -init. (From: Keary Suska <email@hidden>)
 >Re: Creating NSViewController with -init. (From: Kyle Sluder <email@hidden>)
 >Re: Creating NSViewController with -init. (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: CFXMLCreateStringByUnescapingEntities() bombs on "&#13207494"
  • Next by Date: Re: CFXMLCreateStringByUnescapingEntities() bombs on "&#13207494"
  • Previous by thread: Re: Creating NSViewController with -init.
  • Next by thread: Understanding Application crash
  • Index(es):
    • Date
    • Thread