Skip navigation.
 
mlRe: Type introspection with NSMethodSignature, deprecated NSObjCValueType?
FROM : Jim Correia
DATE : Fri Feb 01 22:09:25 2008

On Feb 1, 2008, at 11:23 AM, Benjamin Stiglitz wrote:

>> Given an arbitrary selector, and after having verified that 
>> instances respond to the selector, I'd like to make sure the method 
>> signature matches a particular form.

>
> Any reason you’re doing this? As Glenn points out, this approach is 
> fraught with trouble.
>
> If you’re verifying a plugin, there’s always the option of crashing.


There is a reason. :-)

I was revisiting some old code today and noticed that I was perhaps 
forwarding too many messages.

I have a view controller (my own class, predates NSViewController) 
which hooks into the responder chain when it is active.

The view controller forwards action messages to the view so that it 
can get them when it isn't key.  (In this particular situation, it 
makes sense for the view to be able to zoom, for example, even if some 
other view in the window is key.)

For forwarding the messages, I have essentially 3 options:

1) Forward all unhandled messages from the controller to view.
2) Forward only action messages, as determined by introspection.
3) Forward messages only from a pre-defined list.

Today I am doing 1, which is more forwarding than is necessary. 3 is a 
potential maintenance headache. So I was investigation options for 
implementing #2.

Jim_______________________________________________

Cocoa-dev mailing list (<email_removed>)

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:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>

This email sent to <email_removed>

Related mailsAuthorDate
mlType introspection with NSMethodSignature, deprecated NSObjCValueType? Jim Correia Feb 1, 16:25
mlRe: Type introspection with NSMethodSignature, deprecated NSObjCValueType? glenn andreas Feb 1, 17:02
mlRe: Type introspection with NSMethodSignature, deprecated NSObjCValueType? Benjamin Stiglitz Feb 1, 17:23
mlRe: Type introspection with NSMethodSignature, deprecated NSObjCValueType? Jim Correia Feb 1, 22:03
mlRe: Type introspection with NSMethodSignature, deprecated NSObjCValueType? Jim Correia Feb 1, 22:09
mlRe: Type introspection with NSMethodSignature, deprecated NSObjCValueType? Chris Kane Feb 5, 19:01