代码很简单,
NJS端:
var MasSso = plus.ios.importClass("MasSso");
var masSso = new MasSso();
var hevent = plus.ios.implements("NjsHelloEvent", {
"onEventInvoked:": function(name) {
$.alert("Invoked JSMUI Object’s name: " + name);
});
masSso.setEventObserver(hevent);
masSso.tokenInfo();
OC端:
// 实现类MasSso
@implementation MasSso
@synthesize name=_name;
@synthesize delegate=_delegate;
-(void)updateName:(NSString*)newname{
_name = [newname copy];
}
-(void)setEventObserver:(id<NjsHelloEvent >)delegate{
_delegate = delegate;
}
-(void)tokenInfo{
[TYRZUILogin getTokenImpWithComplete:^(id sender) {
[[self delegate] onEventInvoked: @"test"];
}];
}
在NJS端 $.alert("Invoked JSMUI Object’s name: " + name); 死活打印出来的name值就不是"test",而是一个无法解析的未知类型的object,转成字符串也不是"test". 请问是不是哪里出了问题?
1***@qq.com
解决了吗,遇到了同样的问题
2019-10-28 19:48