class_addMethod and type encodings.
class_addMethod and type encodings.
- Subject: class_addMethod and type encodings.
- From: Ross Tulloch <email@hidden>
- Date: Fri, 2 May 2008 12:29:55 +1000
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.
_______________________________________________
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