9***@qq.com
9***@qq.com
  • 发布:2017-10-17 11:04
  • 更新:2017-10-18 15:53
  • 阅读:1373

plus 如何访问UIPasteboard的pasteboardWithName次方法?

分类:HTML5+

plus 如何访问UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:@"cn.party1.doudizhudz" create:NO];

2017-10-17 11:04 负责人:无 分享
已邀请:
9***@qq.com

9***@qq.com (作者)

有人吗?

回梦無痕

回梦無痕 - 暂停服务

var UIPasteboard  = plus.ios.importClass("UIPasteboard");  
var pasteb = new UIPasteboard({pasteboardWithName:"cn.party1.doudizhudz",create:"NO"});
  • 9***@qq.com (作者)

    var pasteb = new UIPasteboard({pasteboardWithName:"cn.party1.doudizhudz",create:"NO"});


        console.log("pasteb:" + pasteb);  

    var data = pasteb.var pasteb = new UIPasteboard({pasteboardWithName:"cn.party1.doudizhudz",create:"NO"});

    console.log("pasteb:" + pasteb);

    var data = pasteb.dataForPasteboardType("app_info");
    alert("data1:" + data);

    data = plus.ios.invoke(pasteb,"dataForPasteboardType:"
       , "app_info"
    );

    alert("data2:" + data);("app_info");
    alert("data1:" + data);

    data = plus.ios.invoke(pasteb,"dataForPasteboardType:"
       , "app_info"
    );

    alert("data2:" + data);

    pasteb不为空,但是读数据dataForPasteboardType,无法读取,都返回null

    2017-10-17 13:31

9***@qq.com

9***@qq.com (作者)

有人知道解决方法吗?

9***@qq.com

9***@qq.com (作者)

var pasteb = new UIPasteboard({pasteboardWithName:"cn.party1.doudizhudz",create:"NO"});

    console.log("pasteb:"   pasteb);  

    var data = pasteb.dataForPasteboardType("app_info");  
    alert("data1:"   data);  

    data  = plus.ios.invoke(pasteb,"dataForPasteboardType:"  
        , "app_info"  
    );  

    alert("data2:"   data);
回梦無痕

回梦無痕 - 暂停服务

var UIPasteboard  = plus.ios.newObject("UIPasteboard","pasteboardWithName:create:","io.dcloud.H573B78CA","NO");
  • 9***@qq.com (作者)

    var UIPasteboard = plus.ios.newObject("UIPasteboard","pasteboardWithName:create:","cn.party1.doudizhudz","NO");

    alert("UIPasteboard="+UIPasteboard);


        var data11 = plus.ios.invoke(UIPasteboard,"dataForPasteboardType:", "app_info");  
    alert("data1="+data11);

    var data = UIPasteboard.dataForPasteboardType("app_info");
    alert("data="+data);

    还是读不出来数据

    iOS与原生就可以

    UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:@"cn.party1.doudizhudz" create:NO];

    id sss = [NSKeyedUnarchiver unarchiveObjectWithData:[pasteboard dataForPasteboardType:@"app_info"]];

    2017-10-18 10:39

9***@qq.com

9***@qq.com (作者)

还想没有解决,有人知道吗?谢谢

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