简体   繁体   English

Titanium IOS应用程序-无法识别的选择器已发送到实例

[英]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调用dputils.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.

相关问题 iOS App崩溃-无法识别的选择器发送到实例 - IOS App crashes - unrecognized selector sent to instance iOS:无法识别的选择器已发送到实例 - iOS: Unrecognized selector sent to instance 无法识别的选择器已发送到实例ios - unrecognized selector sent to instance ios iOS,无法识别的选择器发送到实例? - iOS, unrecognized selector sent to instance? 使用Parse API在IOS App中将无法识别的选择器发送到实例错误 - unrecognized selector sent to instance error in IOS App using Parse API 由于-[UIView _setLayerConfig:],iOS应用程序崩溃:无法识别的选择器发送到实例 - iOS App crashes because of -[UIView _setLayerConfig:]: unrecognized selector sent to instance 调用sizeToFit时,ios应用崩溃,无法识别的选择器发送到实例 - ios app crashing with unrecognized selector sent to instance when sizeToFit is called 在 IOS 上获取“无法配置 Firebase 应用程序:无法识别的选择器发送到实例” - Getting "Unable to configure Firebase App : unrecognized selector sent to instance" on IOS GoogleMaps基本的iOS演示应用程序崩溃 - 无法识别的选择器发送到实例 - GoogleMaps basic iOS demo app crash - unrecognized selector sent to instance iOS App:无法识别的选择器已发送至实例-录制视频AVFoundation - iOS App: unrecognized selector sent to instance - Recording video AVFoundation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM