Hi,
My code implements a sort of assertions system for validating functions arguments.
I cannot determine the real class of an object. Imagine a hierarchy as the following
MyView = Core.class(Sprite)
...
MainScreen = Core.class(MyView) |
Object -> Sprite -> MyView -> MainScreen
Calling getClass() and getBaseClass() on a MyView object the runtime returns respectively: Sprite and Object.
Even this tests fails
obj:isInstanceOf("MyView") |
or
obj:isInstanceOf("MainScreen") |
Any help?
Thank you all
Mauro
Comments
I can see why Gideros doesn't set it for lua classes, it is because it has no way of knowing how you named your class! That could be added as a third arg to Core.class maybe ? Second arg is already used for base class parameters.
Likes: tetnic
Yes that is the solution I was trying to implement as a workaround
I have also searched for info about macros... but I cannot make it compile. Is it yet available the "macro" plugin? It seems that it can permit to create some interesting macros as the following:
'<a href="https://forum.gideros.rocks/profile/def" rel="nofollow">@def</a> Class(class, super) class = Core.class(super, nil, _STR_(class))
This can help you however: https://wiki.giderosmobile.com/index.php/Macro_Functions
Likes: SinisterSoft
I'm basing on this post, if it's valid yet: http://forum.giderosmobile.com/discussion/comment/48204/#Comment_48204
But I'm not able to make it work.
However I've already implemented my helper functions:
Mauro