b***@qq.com
b***@qq.com
  • 发布:2018-09-12 10:43
  • 更新:2019-06-03 09:57
  • 阅读:1352

【报Bug】IOS NJS 监听广播事件,原生发送关播后程序崩溃

分类:Native.js

详细问题描述
[内容]
使用NJS 监听NSNotificationCenter 的广播,当IOS原生代码 发送广播后,程序立即崩溃.
IOS11 崩溃,IOS9正常,其他尚未测试

重现步骤
[步骤]
注册 NJS监听,原生发送通知

[结果]
程序崩溃
[期望]
正常接收.

运行环境

[手机操作系统] IOS 11
[手机型号] iphone
SDK:ISO 5.5

NJS代码
var NSNotificationCenter = plus.ios.importClass("NSNotificationCenter");
var nc = NSNotificationCenter.defaultCenter();
var delegate = plus.ios.implements("NSObject",{"VideoCallBack:":function(notification){
var data =JSON.parse(notification.plusGetAttribute("object"));

    	 		alert(data);        	 		  
    	 	}});  
			nc.addObserverselectornameobject(delegate,  
    		plus.ios.newObject("@selector","VideoCallBack:"),  
    				"H_CALL_BACK",  
			null);  

IOS OC 代码
[[NSNotificationCenter defaultCenter] postNotificationName:@"H_CALL_BACK" object:"123"];

2018-09-12 10:43 负责人:无 分享
已邀请:
1231312312312

1231312312312

哥们,解决了吗?我也是这问题

菜的要命

菜的要命

我这也是这个问题,这是啥崩溃啊

该问题目前已经被锁定, 无法添加新回复