Objective-C and runtime type inspection

Joel Reymont <>
Thu Aug 17 21:01:13 CEST 2006


On Aug 17, 2006, at 7:37 PM, Bob Ippolito wrote:

> You'll still likely have problems with varargs and paired  
> arguments, e.g.
> +[NSArray arrayWithObjects:...]

I don't remember off hand how this case is handled but all functions  
have a definite type signature. Maybe the varargs go in as an array  
or something. I'll need to inspect NSArray.

> and +[NSArray arrayWithObjects:count:].

This is an easy case because the selector (method name represented as  
a string) is exactly "arrayWithObjects:count:".

I didn't think of it this way but I can try going totally dynamic. I  
could do RTTI the first time a selector is invoked and cache the info  
in a dict, gb_tree or ets table.

The whole point of importing or parsing headers is to generate  
functions whereas Erlang, just like Objective-C, works by message- 
passing.

	Thanks, Joel

--
http://wagerlabs.com/








More information about the erlang-questions mailing list