On Sat, Dec 20, 2008 at 5:16 AM, Graham Cox <graham....@bigpond.com> wrote:
> KVV works pretty well for this - it also solves another related situation
> where I can usefully convert objects to other types in some cases - but what
> I still haven't quite worked out yet is how to *prevent* the situation
> arising in the first place, in other words, given a list of methods, and an
> object class, how to filter out those methods/properties from a list that
> can't accept the object.

There is no way to prevent the situation in the first place using
standard techniques. All that static typing information gets thrown
away when you compile. At runtime all that survives is the knowledge
that your method takes an object pointer of some kind.

You could build a table, either manually or perhaps with the help of
some sort of crazy macro. But there is absolutely no way to get the
NSColor out of -(void)setColor:(NSColor*)c at runtime because that
info simply isn't there.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to