在 ViewController 里实现了这个接口
@implementation ViewController (JSB)
+(void)SelectPhoto:(NSString *) str {
NSLog(@"select photo =%@", str);
}
@end
在 JS 调用时,提示方法不存在
native.reflection.callStaticMethod('ViewController', 'SelectPhoto', '');
在 ViewController 里实现了这个接口
@implementation ViewController (JSB)
+(void)SelectPhoto:(NSString *) str {
NSLog(@"select photo =%@", str);
}
@end
在 JS 调用时,提示方法不存在
native.reflection.callStaticMethod('ViewController', 'SelectPhoto', '');
native.reflection.callStaticMethod('ViewController', 'SelectPhoto:', '');
oc方法有参数的不能忽略掉那个冒号
确实是,可以了