Esword
(James Esword)
October 6, 2015, 3:17am
1
public class MyClass{
public void simple(int a){
}// method1
public void simple(int a, int b){
}// method2
}
I know the method1 can be expressed like: var sel = __selector(simple:);
Then how to express the method2? I’ve tried sth like __selector(simple:b:)
and it won’t work.
ck
(Carlo Kok)
October 6, 2015, 7:11am
2
you’ll probably want __selector(simple::)
there, __selector(simple:b:)
would match:
public void simple(int a) b (int b){
}// method2
Esword
(James Esword)
October 6, 2015, 7:33am
3
Thanks!
Another question for overload methods:
public void simple(int a, bool b){
}
public void simple(int a, int b){
}
I think the compiler will rename the “simple”. Can we refer to them by selector?
ck
(Carlo Kok)
October 6, 2015, 7:55am
4
Not easily. When you use selectors you should make sure they have a distinct name so they don’t get mangled. What do you need the selector name for?
Esword
(James Esword)
October 6, 2015, 8:03am
5
Got it. I’m trying to make some cross-platform reflection utils and learning objc runtime to see if there’re specific limits.
ck
(Carlo Kok)
October 6, 2015, 8:14am
6
ah. Well you CAN get/invoke these. They just have a very long name.
Esword
(James Esword)
October 6, 2015, 8:27am
7
Is there a convenient way to print compiled method names?
I’ve learned that all objc methods will have two hidden arguments: “self” and “_cmd”, but it seems that I can’t refer to “_cmd” in RO C#.
ck
(Carlo Kok)
October 6, 2015, 8:32am
8
hrm one way to do it is to set<IRFilename>filename.ir</IRFilename>
in your project files. The IR will have the IR for the project (but that’s not easy to read). Another way is to dump them through the objc apis.
as for “cmd”, not currently. do you have any usecase for it?
Esword
(James Esword)
October 6, 2015, 8:43am
9
There’re only debug cases for it currently, not urgent.
Esword
(James Esword)
October 7, 2015, 2:57am
10
Thanks, logged as bugs://73306 — for @encode support
Thanks, logged as bugs://73307 — to expose _cmd
bugs://73306 got closed with status wontfix.