I know this maybe a mute point for many, But I really would love a way to attach a class (a normal class, inheriting from object) to a ui object. In a generic way. Yes, I could write a custom class to encapsulate the ui element inside a custom class. However 2 things bother me about this approach, memory and performance overhead as well as losing the ability to code my custom class as I would say a normal button. Well at least I think that's the case. I tried to be smart and stuff my class reference into the transform attribute. But got a error of expecting a ui.transform object (makes sense). I had a glimmer of hope that if I could stuff the reference in there, maybe the underlying code only acknowledges its presence if that objects method are called explicitly on the object(I haven't seen class casting, maybe it's possible). Yeah, slim chance to none I guess. I Had to try. But again, I find my code gets so dirty and unwieldy quickly with this limitation when dealing with lots of ui objects. I accept it could be just my inexperience. I mentioned memory and performance overhead above. But I mention it because one view I present is a calendar. Each day is made up of 5 buttons and 2 views. Could be more by the time I am finished. But that alone is 155 buttons and 62 views on the screen for 31 days. Then I have a header for the days of the week, then a status bar. I also need filler bars for the previous months days etc...
Anyway, getting close to 250++ items on the view. Again, maybe this is not a problem. I just really don't know.
Sorry, I know this is a long winded post, but it's difficult to explain why I really want to be able to attach my own class to a ui element rather than encapsulating it in a custom class. I did briefly give some thought to trying to use the name of the ui element then trying to do something with eval, but I can see big potential problems with the garbage collector with reference counts and other things I don't even understand. But I have seen you guys do some amazing tricky code here before. I was hoping someone maybe able to pull a rabbit out of the hat that will enable me to attach and recover a class to a ui object generically.
Big thank you in advance!
A screen shot of the calendar I make reference to above. This pic has no days of the week or status bars.
https://www.dropbox.com/s/2ga2ndwmfioh9x7/file%206-07-2015%2019%2011%2040.png?dl=0