Re: nibs don't know about protocols?
Re: nibs don't know about protocols?
- Subject: Re: nibs don't know about protocols?
- From: Matt Neuburg <email@hidden>
- Date: Wed, 02 Jun 2010 08:00:43 -0700
- Thread-topic: nibs don't know about protocols?
On or about 6/1/10 12:01 PM, thus spake "Kyle Sluder"
<email@hidden>:
> On Tue, Jun 1, 2010 at 11:00 AM, Matt Neuburg <email@hidden> wrote:
>> So... Are nibs just ignorant of protocols?
>
> I don't believe the nib loading machinery checks protocol conformance
> when it hooks up outlets. It certainly doesn't check class identity,
> so I wouldn't expect it to check protocol conformance either.
But the nib itself does check class identity; you can't draw an outlet to an
instance of the wrong class. So I'm left wondering, then why are you allowed
to draw an outlet to an instance of a class that doesn't adopt the required
protocol? This feels like a bug to me.
And the fact that you can hook up the UIApplication to a delegate that
doesn't adopt UIApplicationDelegate and run the app and have everything
work, with no complaints at any point, *really* feels like a bug, because in
that case what's the protocol for?
Maybe I should move this over to Xcode-tools list? I started here because
protocols are a Cocoa / language thing, not a tools thing. Wht thnk? m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
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