• 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: Connections on NSWindowController sub-classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connections on NSWindowController sub-classes


  • Subject: Re: Connections on NSWindowController sub-classes
  • From: Thomas Wetmore <email@hidden>
  • Date: Wed, 02 Sep 2015 19:13:22 -0400

Fritz,

>> Why doesn’t the compiler complain about these two things?
> …
>
> 2. There would be a complaint about the lack of (declared) protocol compliance because this is Interface Builder, not a compiler.
>
> The link is _defined_ in the NIB, where IB doesn’t care what the definitions are at the time the connections are made.

I had to think about this, but I’m now convinced by your explanation. Thanks.

> The link is _used_ when the NIB is loaded at runtime. IB is perfectly happy to link to outlets and classes that don’t exist, or don’t implement required methods. The first time you’ll know about them is when your application crashes for lack of the requested classes and properties.

Thinking back, I’m sure this (crashing that is) has happened to me in the past!

> The compiler isn’t involved, so it never has a chance to compare links to declared types. It might be an interesting feature to have llvm audit the NIBs before Xcode attempts to run the app, but for now that’s an Exciting Future Direction.

In my naiveté I would assume that the run-time code that establishes the links could introspect that the window’s delegate outlet target conforms to the necessary protocol, leaving the compiler and LLVM out of it. It even seems that the code that creates the NIB file could make the check. Is there is an AnyObject issue involved I don’t understand?
>
> 	— F

Tom Wetmore
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Connections on NSWindowController sub-classes (From: Thomas Wetmore <email@hidden>)
 >Re: Connections on NSWindowController sub-classes (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Any idea why the Xcode (6.4) downloaded from the dev site would be in quarantine?
  • Next by Date: Re: Unable to create outlets/connections for NSMenuItems, but other controls work
  • Previous by thread: Re: Connections on NSWindowController sub-classes
  • Next by thread: Whoops on First Half of Question
  • Index(es):
    • Date
    • Thread