Skip navigation.
 
mlclass_addMethod and type encodings.
FROM : Ross Tulloch
DATE : Fri May 02 04:29:55 2008

Hi,

I've been experimenting with adding methods to classes at runtime and 
have some questions regarding the use and importance of type encodings.

1) class_addMethod requires a types array. This array describes the 
types of the arguments to the method. The type encodings page simply 
states that this info "assists the runtime". I'm wondering how (and 
when) this type information is used by the runtime? In my testing I've 
found the added methods work fine even if you pass an empty types 
string. How bad an idea is passing an empty types string?

2) I've seen some code which uses type encodings like "@4@4@4". I 
can't find any doco for this style of encoding. Any hints?

3) The only doco I can find for type encodings in ObjC is the "Runtime 
System > Type Encodings" page. Is there any other doco I should be 
reading?


Thanks,
Ross.

Related mailsAuthorDate
mlclass_addMethod and type encodings. Ross Tulloch May 2, 04:29
mlRe: class_addMethod and type encodings. Jens Alfke May 2, 06:21
mlRe: class_addMethod and type encodings. Keith Duncan May 2, 12:15