FROM : Jens Alfke
DATE : Fri May 02 06:21:44 2008
On 1 May '08, at 7:29 PM, Ross Tulloch wrote:
> 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?
The types are used by NSMethodSignature, which in turn gets used by
NSInvocation and DistributedObjects, and probably other things.
> 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?
The docs I know of are down in the GCC documentation, in the "compiler
extensions for Objective-C" section. It's buried somewhere in the
reference library in /Developer.
—Jens
DATE : Fri May 02 06:21:44 2008
On 1 May '08, at 7:29 PM, Ross Tulloch wrote:
> 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?
The types are used by NSMethodSignature, which in turn gets used by
NSInvocation and DistributedObjects, and probably other things.
> 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?
The docs I know of are down in the GCC documentation, in the "compiler
extensions for Objective-C" section. It's buried somewhere in the
reference library in /Developer.
—Jens
| Related mails | Author | Date |
|---|---|---|
| Ross Tulloch | May 2, 04:29 | |
| Jens Alfke | May 2, 06:21 | |
| Keith Duncan | May 2, 12:15 |






Cocoa mail archive

