I am trying to associate Lua with Objective-C, and I think that converting strings with NSSelectorFromString()has too much overhead, because Lua must copy all the strings to internalize them (although I'm not sure about that).
NSSelectorFromString()
So, I'm trying to find an easier way to introduce a selector in Lua. The Objective-C selector is an abstract type, but it is defined as a pointer to something:
typedef struct objc_selector *SEL;
This way it looks safe like a regular pointer, so I can pass it to Lua with lightuserdata. It's fine?
lightuserdata
, ( void), - . Objective-C, , , , , , , . , , - .
void
, , - : . , .
C, , , ; . const, lua , , , . , .
const