I need to store a callback function in views and other objects so that I can fire async HTTPClient operations that can later call it to refresh images and texts.
I did something similar to the following, and it works perfectly on iPhone.
var myfun = function(param) { Ti.API.info('Myfun called by ' + param); }; var x = {fun:myfun}; x.fun('x'); // this always works var view = Ti.UI.createView({}); view.fun = myfun; view.fun('view'); // this crashes on AndroidUnfortunately Android crashes on last line with message "TypeError: Cannot call property fun in object ti.modules.titanium.ui.ViewProxy@4380b2c8. It is not a function, it is 'object'."
Any idea on how to convince Android that 'fun' is a function indeed?
Thanks
1 Answer
Accepted Answer
That may be working in a 1_4_X Continuous Integration Build. Instructions for using CI builds are in the Programming Guides section of the documentation.
Your Answer
Think you can help? Login to answer this question!