summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2007-08-13 13:59:04 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2007-08-13 13:59:04 +0200
commitc31e45dda43e1bf10e66a724cb90d51cd6cfaa26 (patch)
tree407813141cf00e4a505c6b30afbe14c47fe52797 /Objective-C
parentc5fce012e0a31684eb96ee8770c6b4fb229d3e60 (diff)
Add a SELECTOR function and use coerced selectors in Objective C code rather than strings.
darcs-hash:d10f9eafc3b21bfcfc027a263e8cee007155b89c
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.h2
-rw-r--r--Objective-C/libobjcl.m14
2 files changed, 9 insertions, 7 deletions
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index 8ccafa7..270fa78 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -38,7 +38,7 @@ objcl_shutdown_runtime (void);
OBJCL_OBJ_DATA
objcl_invoke_method (OBJCL_OBJ_DATA receiver,
- const char *method_name,
+ SEL method_selector,
int argc,
...);
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index ee74944..cd79eb6 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -166,13 +166,12 @@ _objcl_invoke_method (id self_,
OBJCL_OBJ_DATA
objcl_invoke_method (OBJCL_OBJ_DATA receiver,
- const char *method_name,
+ SEL method_selector,
int argc,
...)
{
va_list arglist;
id self_ = NULL;
- SEL selector;
NSMethodSignature *signature;
OBJCL_OBJ_DATA result = malloc (sizeof (struct objcl_object));
@@ -188,13 +187,16 @@ objcl_invoke_method (OBJCL_OBJ_DATA receiver,
case 'E': self_ = receiver->data.exc_val;
}
- selector = NSSelectorFromString ([NSString
- stringWithUTF8String: method_name]);
- signature = [self_ methodSignatureForSelector: selector];
+ signature = [self_ methodSignatureForSelector: method_selector];
va_start (arglist, argc);
- _objcl_invoke_method (self_, result, signature, selector, argc, arglist);
+ _objcl_invoke_method (self_,
+ result,
+ signature,
+ method_selector,
+ argc,
+ arglist);
va_end (arglist);
}
NS_HANDLER