Re: Connections on NSWindowController sub-classes
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