[英]Titanium IOS app - unrecognized selector sent to instance
I have an app for Android and IOS. 我有一个适用于Android和IOS的应用程序。 On Android it works ok, but on IOS, I have this error:
在Android上可以正常运行,但是在IOS上,我出现此错误:
[ERROR] : Script Error {
[ERROR] : backtrace = "#0 () at :0";
[ERROR] : line = 197;
[ERROR] : message = "-[TiUIViewProxy fireEvent:withObject:remove:thisObject:]: unrecognized selector sent to instance 0xeb07400";
[ERROR] : sourceId = 303988736;
[ERROR] : sourceURL = "file:///Users/Almudena/Library/Application%20Support/iPhone%20Simulator/7.0/Applications/380C4F68-33F0-4198-BAB4-B53FC5280609/APPNAME.app/views/interconexiones/InterconexionesSaldoGrafico2.js";
[ERROR] : }
It's very strange because, I have views, and InterconexionesSaldoGrafico2 is a module that return a view. 这很奇怪,因为我有视图,而InterconexionesSaldoGrafico2是返回视图的模块。
The first time I load InterconexionesSaldoGrafico2 works ok, but the second one, I have the previous error. 第一次加载InterconexionesSaldoGrafico2可以正常运行,但是第二次加载时,我遇到了先前的错误。
In this module I load a web view, and the error point at : 在此模块中,我加载一个Web视图,错误点为:
var loadWebView = function(e) {
Ti.App.fireEvent('InitWebviewHTML5Step', {
values : dataInterconexionesJson,
dp : utils.getFactorTodp() //HERE
});
};
I call this method: 我称这种方法:
webviewHTML5StepPortrait.addEventListener('load', loadWebView);
Do you know what could be the error? 您知道可能是什么错误吗?
Thank you very much 非常感谢你
UPDATE 更新
Sometimes exception happens and sometimes the app is closed without saying anything. 有时会发生例外情况,有时会关闭应用程序而不会说什么。
I don't know what 我也不知道
utils.getFactorTodp
utils.getFactorTodp
does, but if you want to pass the function and not evaluate it, you must remove the parenthesis. 可以,但是如果您要传递函数而不求值,则必须删除括号。 So if
dp
is called later by the eventListener, replace utils.getFactorTodp()
by utils.getFactorTodp
因此,如果稍后由eventListener调用
dp
, utils.getFactorTodp()
替换为utils.getFactorTodp
That way, you will reference to the function instead of trying to evaluate it. 这样,您将引用该函数,而不是尝试对其求值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.