var pickerVC = plus.ios.newObject("UIImagePickerController");
var navDelegate = plus.ios.implements("UINavigationControllerDelegate");
var pickerDelegate = plus.ios.implements("UIImagePickerControllerDelegate",{
"imagePickerController:didFinishPickingMediaWithInfo:":function(picker,info){
console.log("111");
console.log(info);
}
});
plus.ios.invoke(pickerVC,"setPickerDelegate",pickerDelegate);
plus.ios.invoke(pickerVC,"setNavDelegate",navDelegate);
var UIApplicationClass = plus.ios.importClass("UIApplication");
var UIAppObj = UIApplicationClass.sharedApplication();
var del = plus.ios.invoke(UIAppObj,"delegate");
var appWindowObj = plus.ios.invoke(del,"window");
var appRootController = plus.ios.invoke(appWindowObj,"rootViewController");
plus.ios.invoke(appRootController,"presentViewController:animated:completion:",pickerVC,true,null);
1 个回复
dafeizhu
实例方法挂载监听器,用setAttribute